|
@ -289,24 +289,16 @@ function Checks |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# Checking services |
|
|
# Checking services |
|
|
@("Windefend", "SecurityHealthService", "wscsvc") | ForEach-Object -Process { |
|
|
try |
|
|
if ($null -eq (Get-Service -Name $_ -ErrorAction Ignore)) |
|
|
{ |
|
|
{ |
|
|
$services = Get-Service -Name Windefend, SecurityHealthService, wscsvc -ErrorAction Stop |
|
|
$Localization.WindowsBroken |
|
|
} |
|
|
exit |
|
|
catch [Microsoft.PowerShell.Commands.ServiceCommandException] { |
|
|
} |
|
|
$Localization.WindowsBroken |
|
|
else |
|
|
exit |
|
|
{ |
|
|
|
|
|
if ((Get-Service -Name $_).Status -eq "running") |
|
|
|
|
|
{ |
|
|
|
|
|
$Script:DefenderServices = $true |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
$Script:DefenderServices = $false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
[array]$notRunning = $services | Where-Object -FilterScript {$_.Status -ne "running"} |
|
|
|
|
|
$Script:DefenderServices = $notRunning.Count -eq 0 |
|
|
|
|
|
|
|
|
# Specifies whether Antispyware protection is enabled |
|
|
# Specifies whether Antispyware protection is enabled |
|
|
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name EditionID) -ne "EnterpriseG") |
|
|
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name EditionID) -ne "EnterpriseG") |
|
|