fix broken system envrioment var PATH #112

This commit is contained in:
zoicware
2026-02-19 14:16:15 -05:00
committed by GitHub
parent 709bdb0a32
commit 2a60b2e41c

View File

@@ -281,6 +281,14 @@ function Write-Status {
}
#some users have messed with the system envrioment variables (for some reason) this breaks inline cmdlets like Reg.exe
#to fix this we can ensure the enviroment variable for this powershell session is set properly
if ($env:PATH -notlike "*$env:SystemRoot\system32;*") {
Write-Status -msg "System Envrioment Variable 'PATH' is corrupted! Fixing for script session..." -errorOutput
$env:PATH = "$env:SystemRoot\system32;$env:SystemRoot;$env:SystemRoot\System32\Wbem;" + $env:PATH
}
#setup script
#=====================================================================================