diff --git a/Fix-RebootIntoSafeMode.ps1 b/Fix-RebootIntoSafeMode.ps1 index 23b32b1..9071777 100644 --- a/Fix-RebootIntoSafeMode.ps1 +++ b/Fix-RebootIntoSafeMode.ps1 @@ -22,7 +22,9 @@ Catch { Write-Error "ERROR: could not configure reboot into normal mode" ; Retur # Configure reboot into Safe Mode with Networking Write-Output "Configuring system to reboot into Safe Mode with Networking" -Try { "%SystemRoot%\System32\bcdedit.exe" /set {default} safeboot network } +$command = "${Env:SystemRoot}\System32\bcdedit.exe" +$params = "/set {default} safeboot network".Split(" ") +Try { & "${command}" $params } Catch { Write-Error "ERROR: could not configure reboot into safe mode with networking" ; Return } # Reboot into Safe Mode with Networking