From 770a009e08c461918e6bd30d39011bdbe35c113b Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Mon, 19 Dec 2022 15:08:51 +0300 Subject: [PATCH] Update Sophia.psm1 --- .../Module/Sophia.psm1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 index fd16ab34..5353bebc 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 @@ -273,13 +273,14 @@ function Checks # Checking services try { - $services = Get-Service -Name Windefend, SecurityHealthService, wscsvc -ErrorAction Stop + $Services = Get-Service -Name Windefend, SecurityHealthService, wscsvc -ErrorAction Stop } - catch [Microsoft.PowerShell.Commands.ServiceCommandException] { + catch [Microsoft.PowerShell.Commands.ServiceCommandException] + { $Localization.WindowsBroken exit } - [array]$notRunning = $services | Where-Object -FilterScript {$_.Status -ne "running"} + [array]$notRunning = $Services | Where-Object -FilterScript {$_.Status -ne "running"} $Script:DefenderServices = $notRunning.Count -eq 0 # Specifies whether Antispyware protection is enabled