[Windows] Use common approach to set machine vars (#8830)

This commit is contained in:
Vasilii Polikarpov
2023-11-17 13:52:52 +01:00
committed by GitHub
parent 045a0de8e2
commit 07e8da79f8
20 changed files with 59 additions and 75 deletions

View File

@@ -54,16 +54,6 @@ function Get-DefaultVariable {
[System.GC]::Collect()
}
function Set-SystemVariable {
param(
[string]$SystemVariable,
[string]$Value
)
[System.Environment]::SetEnvironmentVariable($SystemVariable, $Value, "Machine")
Get-SystemVariable $SystemVariable
}
function Set-DefaultVariable {
param(
[string]$DefaultVariable,
@@ -93,7 +83,7 @@ function Set-MachinePath {
[string]$NewPath
)
Set-SystemVariable PATH $NewPath
[System.Environment]::SetEnvironmentVariable("PATH", $NewPath, "Machine")
}
function Set-DefaultPath {