Skip to content

Commit

Permalink
fix: fix the issue in parsing Windows defender version (#4885)
Browse files Browse the repository at this point in the history
It blocks all PRs.
  • Loading branch information
AbelHu authored Aug 29, 2024
1 parent 6245c2c commit 42f9233
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vhdbuilder/packer/configure-windows-vhd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,9 @@ function Get-LatestWindowsDefenderPlatformUpdate {
$downloadFilePath = [IO.Path]::Combine([System.IO.Path]::GetTempPath(), "Mpupdate.exe")

$currentDefenderProductVersion = (Get-MpComputerStatus).AMProductVersion
$latestDefenderProductVersion = ([xml]((Invoke-WebRequest -UseBasicParsing -Uri:"$global:defenderUpdateInfoUrl").Content)).versions.platform
$doc = New-Object xml
$doc.Load("$global:defenderUpdateInfoUrl")
$latestDefenderProductVersion = $doc.versions.platform

if ($latestDefenderProductVersion -gt $currentDefenderProductVersion) {
Write-Log "Update started. Current MPVersion: $currentDefenderProductVersion, Expected Version: $latestDefenderProductVersion"
Expand Down

0 comments on commit 42f9233

Please sign in to comment.