{"id":12931,"date":"2011-08-22T00:01:00","date_gmt":"2011-08-22T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2011\/08\/22\/use-powershell-to-easily-find-information-about-hotfixes\/"},"modified":"2011-08-22T00:01:00","modified_gmt":"2011-08-22T00:01:00","slug":"use-powershell-to-easily-find-information-about-hotfixes","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/use-powershell-to-easily-find-information-about-hotfixes\/","title":{"rendered":"Use PowerShell to Easily Find Information About Hotfixes"},"content":{"rendered":"<p><strong>Summary<\/strong>: Learn how to use Windows PowerShell to easily find information about Windows Update hotfixes.<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\" \/>Hey, Scripting Guy! I have a problem, and I am hoping that you can help me. I have been using the <b>Get-Hotfix<\/b> cmdlet, but unfortunately, it seems to miss some system updates. I desperately need to perform an audit of our systems, but when I use <b>Get-Hotfix<\/b>, it does not return half of the updates I can see in Control Panel. Therefore, I cannot have confidence in the values that are returned. Is there something I am missing? Help me, oh great Scripting Guy!<\/p>\n<p>&mdash;JM<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\" \/>Hello JM,<\/p>\n<p>Microsoft Scripting Guy Ed Wilson here. When I was preparing for my talk for the TechReady conference on troubleshooting Windows 7 reliability issues, I noticed that the <b>Win32_ReliabilityRecords<\/b> WMI class returns information from the <b>Microsoft-Windows-WindowsUpdateClient<\/b> source. It dawned on me that I could query the WMI class for that source of information. As I investigated further, I saw that the <b>productname<\/b> field included the name of the update. This opens up all kinds of possibilities.<\/p>\n<p>Before I get too carried away, I need to first investigate the <b>Get-HotFix<\/b> cmdlet. I send it to the <b>Get-Member<\/b> cmdlet, and see that it wraps the <b>Win32_QuickFixEngineering<\/b> WMI class, as shown here:<\/p>\n<p style=\"padding-left: 30px\">PS C:\\Users\\ed.IAMMRED&gt; Get-HotFix | gm<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp; TypeName: System.Management.ManagementObject#root\\cimv2\\Win32_QuickFixEngineering<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p style=\"padding-left: 30px\"><span style=\"text-decoration: underline\">Name<\/span>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style=\"text-decoration: underline\">MemberType<\/span>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style=\"text-decoration: underline\">Definition<\/span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">Caption &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String Caption {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">CSName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String CSName {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String Description {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">FixComments&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String FixComments {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">HotFixID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String HotFixID {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">InstallDate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String InstallDate {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">InstalledBy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String InstalledBy {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">Name&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String Name {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">ServicePackInEffect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String ServicePackInEffect {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">Status&nbsp;&nbsp;&n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;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Int32 __GENUS {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">__NAMESPACE&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String __NAMESPACE {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">__PATH&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String __PATH {get;set;}&n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\/p>\n<p style=\"padding-left: 30px\">__SERVER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String __SERVER {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">__SUPERCLASS&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String __SUPERCLASS {get;set;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">PSStatus&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PropertySet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PSStatus {__PATH, Status}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">ConvertFromDateTime&nbsp;&nbsp;&nbsp; ScriptMethod&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Object ConvertFromDateTime();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">ConvertToDateTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ScriptMethod&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Object ConvertToDateTime();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">InstalledOn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ScriptProperty&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Object InstalledOn {get=if ([environment]::osversion.v&#8230;<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p>The problem is that only certain types of updates are picked up by <b>Win32_QuickFixEngineering<\/b>. I examine the number of records that are recorded on my system by piping the results to <b>Measure-Object<\/b>. The command and associated output are shown here:<\/p>\n<p style=\"padding-left: 30px\">PS C:\\Users\\ed.IAMMRED&gt; Get-HotFix | Measure-Object<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p style=\"padding-left: 30px\">Count&nbsp;&nbsp;&nbsp; : 55<\/p>\n<p style=\"padding-left: 30px\">Average&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">Sum&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">Maximum&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">Minimum&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">Property :<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p>On my system, the <b>Get-Hotfix<\/b> cmdlet returns 55 updates. I am not going to go through the process of trying to see which updates appear and which ones are not visible, but I want to compare the results with what I obtain by querying the <b>Win32_ReliabilityRecords<\/b> WMI class. The command and associated output are shown here:<\/p>\n<p style=\"padding-left: 30px\">PS C:\\Users\\ed.IAMMRED&gt; gwmi -cl win32_reliabilityRecords `<\/p>\n<p style=\"padding-left: 30px\">-filter &#8220;sourcename = &#8216;Microsoft-Windows-WindowsUpdateClient'&#8221; |<\/p>\n<p style=\"padding-left: 30px\">Measure-Object&nbsp;<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p style=\"padding-left: 30px\">Count&nbsp;&nbsp;&nbsp; : 180<\/p>\n<p style=\"padding-left: 30px\">Average&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">Sum&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">Maximum&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">Minimum&nbsp; :<\/p>\n<p style=\"padding-left: 30px\">Property :<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p>To explore the type of data returned from the <b>Win32_ReliabilityRecords<\/b> WMI class, I perform a quick query and focus only on records with a source from the <b>*updateClient<\/b>. This query is shown here:<\/p>\n<p style=\"padding-left: 30px\">gwmi -cl win32_reliabilityRecords `<\/p>\n<p style=\"padding-left: 30px\">-filter &#8220;sourcename = &#8216;Microsoft-Windows-WindowsUpdateClient'&#8221;<\/p>\n<p>The query and associated output are shown in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/4452.HSG-8-22-11-01.png\"><img decoding=\"async\" style=\"border: 0px\" title=\"Image of query and associated output\" alt=\"Image of query and associated output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/4452.HSG-8-22-11-01.png\" \/><\/a><\/p>\n<p>A number of properties are available from the <b>Win32_ReliabilityRecords<\/b> WMI class. The <b>timegenerated<\/b> property displays the date\/time value in WMI&rsquo;s infamous UTC time fashion. Luckily, Windows PowerShell adds a <b>ConvertToDateTime<\/b> method to WMI objects, and therefore it can be used to convert the UTC time to something a bit more readable. The <b>user<\/b><i> <\/i>property records the user who installed the updates, and the <b>productname<\/b><i> <\/i>property lists the actual update. In many cases the user will be NT Authority\\System, so the <b>user<\/b><i> <\/i>property may not be the most useful property to retrieve. The <b>productname<\/b><i> <\/i>name tends to be really long, and to take up a decent amount of screen real estate when it is displayed. The <b>Select-Object<\/b> returns an object that can be further processed, but unfortunately, it does not maximize screen output. Consider using one of the <b>Format*<\/b> cmdlets to create an easier display to read. In the following code, I grab all of the <b>Win32_ReliabilityRecords<\/b> that come from the <b>Microsoft-Windows-WindowsUpdateClient<\/b> source, and I use <b>Select<\/b> to choose the <b>Timegenerated<\/b>, <b>User<\/b>, and <b>ProductName<\/b> properties. I also use a hash table to create a customized display, a column head of <b>Date<\/b> instead of <b>TimeGenerated<\/b>, and a <b>datetime<\/b> display that is easy to read. The code is shown here:<\/p>\n<p style=\"padding-left: 30px\">gwmi -cl win32_reliabilityRecords `<\/p>\n<p style=\"padding-left: 30px\">-filter &#8220;sourcename = &#8216;Microsoft-Windows-WindowsUpdateClient'&#8221; |<\/p>\n<p style=\"padding-left: 30px\">select @{LABEL = &#8220;date&#8221;;EXPRESSION = {$_.ConvertToDateTime($_.timegenerated)}},<\/p>\n<p style=\"padding-left: 30px\">user, productname<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p>The code and the associated output are shown in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3580.HSG-8-22-11-02.png\"><img decoding=\"async\" style=\"border: 0px\" title=\"Image of code and associated output\" alt=\"Image of code and associated output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3580.HSG-8-22-11-02.png\" \/><\/a><\/p>\n<p>If the installation of an update fails, it appears as an installation failure in the <b>message<\/b> property. In addition to the indication of failure, the reason for the failed installation also appears. It is therefore a good idea to filter for a message that will match the word <i>failure.<\/i> Regular expressions would be a great tool to use here, but a simple match (which uses regular expressions) will also work. Here is the code I used to find failed updates:<\/p>\n<p style=\"padding-left: 30px\">gwmi -cl win32_reliabilityRecords `<\/p>\n<p style=\"padding-left: 30px\">-filter &#8220;sourcename = &#8216;Microsoft-Windows-WindowsUpdateClient'&#8221; |<\/p>\n<p style=\"padding-left: 30px\">where { $_.message -match &#8216;failure&#8217; } |<\/p>\n<p style=\"padding-left: 30px\">select -ExpandProperty message<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p>The code and associated output are shown in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1780.HSG-8-22-11-03.png\"><img decoding=\"async\" style=\"border: 0px\" title=\"Image of code and associated output\" alt=\"Image of code and associated output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1780.HSG-8-22-11-03.png\" \/><\/a><\/p>\n<p>I decided to modify the output so that I could more easily read the date and the update that failed. I used the same basic code that formats the output for the date, but added another column heading for <b>failed update<\/b> and I kept the <b>Where-Object<\/b> that looks for the word <i>failure<\/i> in the <b>message<\/b> property. Here is the revised code:<\/p>\n<p style=\"padding-left: 30px\">gwmi -cl win32_reliabilityRecords `<\/p>\n<p style=\"padding-left: 30px\">-filter &#8220;sourcename = &#8216;Microsoft-Windows-WindowsUpdateClient'&#8221; |<\/p>\n<p style=\"padding-left: 30px\">where { $_.message -match &#8216;failure&#8217; } |<\/p>\n<p style=\"padding-left: 30px\">select @{LABEL = &#8220;date&#8221;;EXPRESSION = {$_.ConvertToDateTime($_.timegenerated)}},<\/p>\n<p style=\"padding-left: 30px\">@{LABEL = &#8220;failed update&#8221;; EXPRESSION = { $_.productname }}| FT -AutoSize &ndash;Wrap<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p>The revised code and the associated output are shown in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/4670.HSG-8-22-11-04.png\"><img decoding=\"async\" style=\"border: 0px\" title=\"Image of revised code and associated output\" alt=\"Image of revised code and associated output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/4670.HSG-8-22-11-04.png\" \/><\/a><\/p>\n<p>I decide to hone in on a specific failed update. I modify the <b>Where-Object<\/b> so that I am not looking for the specific word <i>failed<\/i>, but instead am looking for the specific update number. The modified query is shown here:<\/p>\n<p style=\"padding-left: 30px\">gwmi -cl win32_reliabilityRecords `<\/p>\n<p style=\"padding-left: 30px\">-filter &#8220;sourcename = &#8216;Microsoft-Windows-WindowsUpdateClient'&#8221; |<\/p>\n<p style=\"padding-left: 30px\">where { $_.message -match &#8216;KB973688&#8217; } |<\/p>\n<p style=\"padding-left: 30px\">select @{LABEL = &#8220;date&#8221;;EXPRESSION = {$_.ConvertToDateTime($_.timegenerated)}},<\/p>\n<p style=\"padding-left: 30px\">@{LABEL = &#8220;update&#8221;; EXPRESSION = { $_.productname }}| FT -AutoSize &ndash;Wrap<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p>The code and associated output are shown in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8255.HSG-8-22-11-05.png\"><img decoding=\"async\" style=\"border: 0px\" title=\"Image of code and associated output\" alt=\"Image of code and associated output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8255.HSG-8-22-11-05.png\" \/><\/a><\/p>\n<p>From the preceding figure, I can see that the update appears twice. The second attempt is a few minutes after the first attempt, but the <b>productname<\/b> property does not indicate success or failure. For this, I need to go back and query the <b>message<\/b><i> <\/i>property. The modified code is shown here:<\/p>\n<p style=\"padding-left: 30px\">gwmi -cl win32_reliabilityRecords `<\/p>\n<p style=\"padding-left: 30px\">-filter &#8220;sourcename = &#8216;Microsoft-Windows-WindowsUpdateClient'&#8221; |<\/p>\n<p style=\"padding-left: 30px\">where { $_.message -match &#8216;KB973688&#8217; } |<\/p>\n<p style=\"padding-left: 30px\">select -expand message<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p>The code and associated output are shown in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7608.HSG-8-22-11-06.png\"><img decoding=\"async\" style=\"border: 0px\" title=\"Image of code and associated output\" alt=\"Image of code and associated output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7608.HSG-8-22-11-06.png\" \/><\/a><\/p>\n<p>Hmmm, so it seems that at least one of my failed updates actually installed. I decide to modify my query once again. This time, I use a compound <b>Where-Object<\/b> (<b>where<\/b> is the alias) to look for both updates by KB number. I get rid of the <b>Select-Object<\/b> (<b>select<\/b> is alias) cmdlet in favor of the <b>Format-Table<\/b> cmdlet (<b>ft<\/b> is the alias) so that I have a better display of output. I use both the <i>autosize <\/i>and the <i>wrap <\/i>parameters for <b>Format-Table<\/b>. In addition, I decide to use the <b>message<\/b><i> <\/i>property instead of just the <b>productname<\/b> property because it includes both the product name and the installation status. Here is the revised query:<\/p>\n<p style=\"padding-left: 30px\">gwmi -cl win32_reliabilityRecords `<\/p>\n<p style=\"padding-left: 30px\">-filter &#8220;sourcename = &#8216;Microsoft-Windows-WindowsUpdateClient'&#8221; |<\/p>\n<p style=\"padding-left: 30px\">where { $_.message -match &#8216;KB973688&#8217; -OR $_.message-Match &#8216;KB954430&#8217;} |<\/p>\n<p style=\"padding-left: 30px\">FT @{LABEL = &#8220;date&#8221;;EXPRESSION = {$_.ConvertToDateTime($_.timegenerated)}},<\/p>\n<p style=\"padding-left: 30px\">message -autosize &ndash;wrap<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p>The code and the associated output are shown in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3240.HSG-8-22-11-07.png\"><img decoding=\"async\" style=\"border: 0px\" title=\"Image of code and associated output\" alt=\"Image of code and associated output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/3240.HSG-8-22-11-07.png\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>JM that is all there is to using the reliability provider to obtain information about Windows Update hotfixes.&nbsp;<\/p>\n<p style=\"padding-left: 30px\"><b>Note<\/b>&nbsp; &nbsp;For more information about using the <b>Reliability<\/b> provider to troubleshoot Windows systems, check out these <a href=\"http:\/\/blogs.technet.com\/search\/searchresults.aspx?q=%22reliability%20provider%22&amp;sections=7618\">Hey, Scripting Guy! Blog posts<\/a>.<\/p>\n<p>I invite you to check back tomorrow for more Windows PowerShell goodness.<\/p>\n<p>&nbsp;<\/p>\n<p>I invite you to follow me on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p><b>Ed Wilson, Microsoft Scripting Guy<\/b><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Learn how to use Windows PowerShell to easily find information about Windows Update hotfixes. &nbsp; Hey, Scripting Guy! I have a problem, and I am hoping that you can help me. I have been using the Get-Hotfix cmdlet, but unfortunately, it seems to miss some system updates. I desperately need to perform an audit [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[31,3,4,203,45,6],"class_list":["post-12931","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-operating-system","tag-scripting-guy","tag-scripting-techniques","tag-service-packs-and-hotfixes","tag-windows-powershell","tag-wmi"],"acf":[],"blog_post_summary":"<p>Summary: Learn how to use Windows PowerShell to easily find information about Windows Update hotfixes. &nbsp; Hey, Scripting Guy! I have a problem, and I am hoping that you can help me. I have been using the Get-Hotfix cmdlet, but unfortunately, it seems to miss some system updates. I desperately need to perform an audit [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/12931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=12931"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/12931\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=12931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=12931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=12931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}