Skip to content

Commit

Permalink
closes #1
Browse files Browse the repository at this point in the history
Added recommendation on issue #1
  • Loading branch information
Wiszanyel authored Oct 18, 2023
1 parent 9522241 commit aebdefc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Create-StagedMaintenanceConfiguration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Write-Output "Getting the latest maintenance configuration execution run..."

$argQuery = @"
patchinstallationresources
| where type == 'microsoft.compute/virtualmachines/patchinstallationresults'
| where type endswith '/patchinstallationresults'
| extend maintenanceRunId=tolower(split(properties.maintenanceRunId,'/providers/microsoft.maintenance/applyupdates')[0])
| where maintenanceRunId == '$MaintenanceConfigurationId'
| top 1 by todatetime(properties.lastModifiedDateTime)
Expand All @@ -93,7 +93,7 @@ Write-Output "Querying for packages to install..."

$argQuery = @"
patchinstallationresources
| where type == 'microsoft.compute/virtualmachines/patchinstallationresults'
| where type endswith '/patchinstallationresults'
| extend maintenanceRunId=tolower(split(properties.maintenanceRunId,'/providers/microsoft.maintenance/applyupdates')[0])
| where maintenanceRunId == '$MaintenanceConfigurationId'
| where todatetime(properties.lastModifiedDateTime) > todatetime('$($lastRunDateTime[0].lastRunDateTime.ToString("u"))')
Expand All @@ -103,7 +103,7 @@ patchinstallationresources
| extend deploymentStatus = tostring(properties.status)
| join kind=inner (
patchinstallationresources
| where type == 'microsoft.compute/virtualmachines/patchinstallationresults/softwarepatches'
| where type endswith '/patchinstallationresults/softwarepatches'
| where todatetime(properties.lastModifiedDateTime) > todatetime('$($lastRunDateTime[0].lastRunDateTime.ToString("u"))')
| extend vmId = tostring(split(tolower(id), '/patchinstallationresults/')[0])
| extend patchName = tostring(properties.patchName)
Expand Down

0 comments on commit aebdefc

Please sign in to comment.