Manually add system32 to System PATH when it's missing #548

This commit is contained in:
Raphire
2026-04-17 20:09:47 +02:00
parent 342f498344
commit ff98febb9a

View File

@@ -143,8 +143,16 @@ if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") {
Exit
}
# Display ASCII art launch logo in CLI
Clear-Host
# Ensure required Windows command paths are present in PATH for this session.
$system32Path = "$env:SystemRoot\System32"
if ($env:PATH -notmatch "(?i)(^|;)$([regex]::Escape($system32Path))(?=;|$)") {
$env:PATH = "$env:SystemRoot\System32;$env:SystemRoot;" + $env:PATH
Write-Warning "System32 path was missing from PATH environment variable, it has been added for this session."
}
# Display ASCII art launch logo in CLI
Write-Host ""
Write-Host ""
Write-Host " " -NoNewline; Write-Host " ^" -ForegroundColor Blue