Another mop up commit to add missing changes from the last mop-up.

This commit is contained in:
Shady Ibraheem
2019-12-13 09:48:00 -05:00
parent 95d3c31f21
commit 1dcd276b1e
188 changed files with 7333 additions and 7393 deletions

View File

@@ -1,68 +1,68 @@
function Test-MachinePath{
[CmdletBinding()]
param(
[string]$PathItem
)
$currentPath = Get-MachinePath
$pathItems = $currentPath.Split(';')
if($pathItems.Contains($PathItem))
{
return $true
}
else
{
return $false
}
}
function Set-MachinePath{
[CmdletBinding()]
param(
[string]$NewPath
)
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name Path -Value $NewPath
return $NewPath
}
function Add-MachinePathItem
{
[CmdletBinding()]
param(
[string]$PathItem
)
$currentPath = Get-MachinePath
$newPath = $PathItem + ';' + $currentPath
return Set-MachinePath -NewPath $newPath
}
function Get-MachinePath{
[CmdletBinding()]
param(
)
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
return $currentPath
}
function Get-SystemVariable{
[CmdletBinding()]
param(
[string]$SystemVariable
)
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable).$SystemVariable
return $currentPath
}
function Set-SystemVariable{
[CmdletBinding()]
param(
[string]$SystemVariable,
[string]$Value
)
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable -Value $Value
return $Value
}
function Test-MachinePath{
[CmdletBinding()]
param(
[string]$PathItem
)
$currentPath = Get-MachinePath
$pathItems = $currentPath.Split(';')
if($pathItems.Contains($PathItem))
{
return $true
}
else
{
return $false
}
}
function Set-MachinePath{
[CmdletBinding()]
param(
[string]$NewPath
)
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name Path -Value $NewPath
return $NewPath
}
function Add-MachinePathItem
{
[CmdletBinding()]
param(
[string]$PathItem
)
$currentPath = Get-MachinePath
$newPath = $PathItem + ';' + $currentPath
return Set-MachinePath -NewPath $newPath
}
function Get-MachinePath{
[CmdletBinding()]
param(
)
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
return $currentPath
}
function Get-SystemVariable{
[CmdletBinding()]
param(
[string]$SystemVariable
)
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable).$SystemVariable
return $currentPath
}
function Set-SystemVariable{
[CmdletBinding()]
param(
[string]$SystemVariable,
[string]$Value
)
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable -Value $Value
return $Value
}