Skip to content

Commit

Permalink
Simplify the Antivirus enabled status detection
Browse files Browse the repository at this point in the history
  • Loading branch information
akunzai committed Jul 30, 2023
1 parent 3f1dcae commit 4c41140
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rules/Antivirus.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function Test($config) {
Write-CheckList $false "$($i18n.UpdatedStatus): $($i18n.FailedToCheckUpdateStatus)"
return
}
$enabled = $products | Where-Object { ('0x{0:x}' -f $_.ProductState).SubString(3, 2) -notmatch '00|01' } | Sort-Object -Property timestamp -Descending
$enabled = $products | Where-Object { ('0x{0:x}' -f $_.ProductState).SubString(3, 2) -eq '10' } | Sort-Object -Property timestamp -Descending
Write-CheckList ($enabled.Count -gt 0) "$($i18n.Installed): $($enabled[0].displayName)"
if ($enabled.Count -gt 0) {
$upToDate = $enabled | Where-Object { ('0x{0:x}' -f $_.ProductState).SubString(5) -eq '00' }
Expand Down

0 comments on commit 4c41140

Please sign in to comment.