LukeLegend
Contributor
Contributor

Anyone have a script that can export VUMs baseline updates prior to applying them, need to demonstrate the before and after state prior to applying VUM updates.

Anyone have a script that can export outstanding/pending VUM updates prior to applying them and then afterwards.  Have been asked to demonstrate the before and after state for host updates so we can show an audit of what has been applied.  Or if anyone knows an easier method of doing this feel free to share.

0 Kudos
1 Reply
LucD
Leadership
Leadership

The Get-Compliance cmdlet should help you with that.

You could run the following before and after the patching cycle.

Get-Baseline -TargetType Host -BaselineType Patch -PipelineVariable base |

ForEach-Object -Process {

   Get-VMHost -PipelineVariable esx |

   Get-Compliance -baseline $base -Detailed |

   ForEach-Object -Process {

   $_.NotCompliantPatches |

   ForEach-Object -Process {

   New-Object PSObject -Property @{

   Baseline = $base.Name

   VMHost = $esx.Name

   Patch = $_.Name

   ID = $_.IdByVendor

   ReleaseDate = $_.ReleaseDate

   Category = $_.Category

   Severity = $_.Severity

   }

   }

   }

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos