-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Enhance 'install-powershell.ps1' to work on Linux/MacOS #5411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
adityapatwardhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some non-blocking comments
| $userPath = [System.Environment]::GetEnvironmentVariable("Path", "User") | ||
| $userPath = $Destination + [System.IO.Path]::PathSeparator + $userPath | ||
| [System.Environment]::SetEnvironmentVariable("Path", $userPath, "User") | ||
| Write-Verbose "'$Destination' is added to the Path" -Verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, since we have CmdletBinding() we should not force -verbose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These messages are actually intentionally written out so that a user roughly knows what the script is doing when running it.
|
|
||
| Expand-Archive -Path $packagePath -DestinationPath $Destination | ||
| if ($IsWinEnv) { | ||
| Expand-Archive -Path $packagePath -DestinationPath $Destination |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we delete the compressed package after expansion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compressed package will be deleted. The compressed package is downloaded to $tempDir which will be deleted in the finally block at the end of the script.
|
Linux job succeeded, but the macOS job was canceled again. |
Enhance 'install-powershell.ps1' to work on Linux/MacOS.
When
-AddToPathis specified: