Skip to content

Commit

Permalink
Remove Update-SessionEnvironment dependency (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcabreramsft authored Sep 11, 2023
1 parent 88b5089 commit 1148ffd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@ tar -xf "$INSTALL_DIR\$TAR" -C $INSTALL_DIR
mv -Force "$INSTALL_DIR\release\$BINARY_NAME" $INSTALL_DIR
">>> EXTRACTED BINARY TAR."

Update-SessionEnvironment
$PATH_CONTENT = [Environment]::GetEnvironmentVariable('path', 'User')
if ($PATH_CONTENT -ne $null)
{
if ($PATH_CONTENT -split ';' -NotContains $INSTALL_DIR)
{
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable('Path', 'User') + ";$INSTALL_DIR" , [System.EnvironmentVariableTarget]::User)
Update-SessionEnvironment
$env:Path += ";$INSTALL_DIR"
}
}
">>> INSTALLED BINARY."

rm -r -Force "$INSTALL_DIR\$TAR"
rm -r -Force "$INSTALL_DIR\release\"
">>> CLEANED UP."
">>> CLEANED UP."

0 comments on commit 1148ffd

Please sign in to comment.