In addition to generating update reports in PowerShell, the results can also be exported into Excel or other tools. By exporting the update or inventory reports to Excel, we can use a familiar tool to view, filter, and display the information in ways that are useful to us.
In this recipe, we will be using the process in the prior recipe to query the update server database. We will then return the resulting dataset and export it into a format that Excel can utilize.
Carry out the following steps to export WSUS data to Excel:
Create the dataset object. This is the same process as the Creating an update report recipe.
Export the dataset to an XML file:
$ds.Tables[0].WriteXml("C:\temp\inventory.xml")
Open the XML file with Excel: