From 4cec14c893f9f59619ad1d55554db242a3346a58 Mon Sep 17 00:00:00 2001 From: David Yoder Date: Tue, 23 Apr 2024 11:36:37 -0400 Subject: [PATCH] fix detecting safe mode with networking --- Remove-AllESETProducts.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Remove-AllESETProducts.ps1 b/Remove-AllESETProducts.ps1 index 6050739..e04d6aa 100644 --- a/Remove-AllESETProducts.ps1 +++ b/Remove-AllESETProducts.ps1 @@ -1,5 +1,8 @@ -# Are we running in Safe Mode? -Switch ( ($Env:SAFEBOOT_OPTIONS).ToUpper() -eq "NETWORK" ) { +# Are we running in Safe Mode with Networking? +Try { If ( ($Env:SAFEBOOT_OPTIONS).ToUpper() -eq "NETWORK" ) { $InSafeNetMode = $true } Else { $InSafeNetMode = $false } } +Catch { $InSafeNetMode = $false } + +Switch ( $InSafeNetMode ) { # We're in Safe Mode $true {