Skip to content

Commit

Permalink
fix: fix xml issue in win vhd test (Azure#4893)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbelHu authored Sep 3, 2024
1 parent 522875b commit 2d670df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vhdbuilder/packer/test/windows-vhd-content-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,9 @@ function Test-ExcludeUDPSourcePort {

function Test-WindowsDefenderPlatformUpdate {
$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-ErrorWithTimestamp "Update failed. Current MPVersion: $currentDefenderProductVersion, Expected Version: $latestDefenderProductVersion"
Expand Down

0 comments on commit 2d670df

Please sign in to comment.