Set-EnvVariable + minor fix to SystemName

This commit is contained in:
lksz@work 2020-11-24 13:15:47 -05:00
parent 25ec753675
commit 80a488484b
3 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,11 @@
[CmdletBinding()]param(
[string]$Name,
[object]$Value,
[ValidateSet('User','Machine')]
[string]$Persist
)
Set-Item -Path (Join-Path "env:" $Name) -Value $Value
if( $Persist ) {
[environment]::setEnvironmentVariable($Name, $Value, $Persist)
}