Enhance 'install-powershell.ps1' to work on Linux/MacOS#5411
Enhance 'install-powershell.ps1' to work on Linux/MacOS#5411daxian-dbw merged 4 commits intoPowerShell:masterfrom
Conversation
adityapatwardhan
left a comment
There was a problem hiding this comment.
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.
I think, since we have CmdletBinding() we should not force -verbose
There was a problem hiding this comment.
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.
Should we delete the compressed package after expansion?
There was a problem hiding this comment.
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: