renevanosnabrugge / vsts-promotepackage-task

Promote a package in VSTS to a Release View
MIT License
21 stars 25 forks source link

$IsWindows is read-only since PS 6.0 #49

Closed alex737876 closed 1 year ago

alex737876 commented 4 years ago

Opening vsts-promotepackage-task\vsts-promotepackage-task\vsts-promotepackage-task.ps1 in latest PS VS Code extension gives an error like this:

Starting from PowerShell 6.0, the Variable 'IsWindows' cannot be assigned any more since it is a readonly automatic variable that is built into PowerShell, please use a different name.

Am opening a pull request

NightOwl888 commented 4 years ago

The reason for this is because IsWindows did not exist in earlier versions of Powershell. It is only written to if it is not populated already (indicating it is on a newer version of Powershell that populates it automatically).

alex737876 commented 4 years ago

Yes, got it. The issue is, that setting it in PS > 6.0 is giving an exception that says Starting from PowerShell 6.0, the Variable 'IsWindows' cannot be assigned any more since it is a readonly automatic variable that is built into PowerShell, please use a different name.

So i thought would be better not setting it at all, to prevent PS >= 6.0 Errors :) See Pull Request #50

alex737876 commented 4 years ago

@renevanosnabrugge @NightOwl888 what do you think about that?