2023-08-10 02:41:08 +00:00
|
|
|
param (
|
|
|
|
[parameter(Mandatory=$true)]
|
2023-09-10 20:50:19 +00:00
|
|
|
[string]$orcaPath,
|
|
|
|
|
|
|
|
[switch]$remove
|
2023-08-10 02:41:08 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
$arrPath = [System.Environment]::GetEnvironmentVariable('PATH', 'User') -split ';'
|
|
|
|
$arrPath = $arrPath | Where-Object { $_ -ne $orcaPath } | Where-Object { $_ -ne '' }
|
2023-09-10 20:50:19 +00:00
|
|
|
if (-not $remove) {
|
|
|
|
$arrPath += $orcaPath
|
|
|
|
}
|
|
|
|
|
|
|
|
$newPath = $arrPath -join ';'
|
2023-08-10 02:41:08 +00:00
|
|
|
|
|
|
|
[System.Environment]::SetEnvironmentVariable('PATH', $newPath, 'User')
|