From af90aba36516ffa47d03e368ca8d68dfbddb9c4b Mon Sep 17 00:00:00 2001 From: David Yoder Date: Mon, 22 Apr 2024 12:44:11 -0400 Subject: [PATCH] launch exe better --- Fix-RebootIntoSafeMode.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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