orca/scripts/updatepath.ps1

12 lines
377 B
PowerShell
Raw Permalink Normal View History

param (
[parameter(Mandatory=$true)]
[string]$orcaPath
)
$arrPath = [System.Environment]::GetEnvironmentVariable('PATH', 'User') -split ';'
$arrPath = $arrPath | Where-Object { $_ -ne $orcaPath } | Where-Object { $_ -ne '' }
$newPath = ($arrPath + $orcaPath) -join ';'
[System.Environment]::SetEnvironmentVariable('PATH', $newPath, 'User')
# echo $newPath