PowerShell

Get Windows 10 current patch information using PowerShell script

Get Windows 10 current patch information using PowerShell script

Usually, users who wish to find out whether the latest cumulative update is installed on their Windows 10 systemuse this method to check the Windows 10 Update History. In this post, we will show you how to get current patch information for Windows 10 using a PowerShell script.

PowerShell script to check Windows Update status

The PowerShell script can be used to report which OS build a Windows 10 computer is currently on as well as which update is the latest update available to the device. It can also report on all Windows updates published for the version of Windows 10 a workstation is currently on.

When you run the script, the following information will be displayed:

To get Windows 10 current patch information using PowerShell script, you need to create and run the PowerShell script using the code below from Github.

[CmdletBinding()] Param( [switch]$ListAllAvailable, [switch]$ExcludePreview, [switch]$ExcludeOutofBand ) $ProgressPreference = 'SilentlyContinue' $URI = "https://aka.ms/WindowsUpdateHistory" # Windows 10 release history Function Get-MyWindowsVersion  [CmdletBinding()] Param ( $ComputerName = $env:COMPUTERNAME ) $Table = New-Object System.Data.DataTable $Table.Columns.AddRange(@("ComputerName","Windows Edition","Version","OS Build")) $ProductName = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name ProductName).ProductName Try  $Version = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name ReleaseID -ErrorAction Stop).ReleaseID  Catch  $Version = "N/A"  $CurrentBuild = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name CurrentBuild).CurrentBuild $UBR = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name UBR).UBR $OSVersion = $CurrentBuild + "." + $UBR $TempTable = New-Object System.Data.DataTable $TempTable.Columns.AddRange(@("ComputerName","Windows Edition","Version","OS Build")) [void]$TempTable.Rows.Add($env:COMPUTERNAME,$ProductName,$Version,$OSVersion) Return $TempTable  Function Convert-ParsedArray  Param($Array) $ArrayList = New-Object System.Collections.ArrayList foreach ($item in $Array)  [void]$ArrayList.Add([PSCustomObject]@ Update = $item.outerHTML.Split('>')[1].Replace('')[1].Replace('')[1].Replace('

You can exclude Preview or Out-of-band updates available that are more recent than the one you have installed from being reported as the latest available update, so you can just focus on the cumulative updates by running the command below:

Get-CurrentPatchInfo -ExcludePreview -ExcludeOutofBand 

You can also list all Windows updates that Microsoft has published for your OS version with the following command:

Get-CurrentPatchInfo -ListAvailable

If you want to exclude Preview and Out-of-band updates from the list but list all Windows updates that Microsoft have published for your OS version, run the command below:

Get-CurrentPatchInfo -ListAvailable -ExcludePreview -ExcludeOutofBand

That's it!

Gry Battle for Wesnoth Tutorial
Battle for Wesnoth Tutorial
The Battle for Wesnoth is one of the most popular open source strategy games that you can play at this time. Not only has this game been in developmen...
Gry 0 A.D. Tutorial
0 A.D. Tutorial
Out of the many strategy games out there, 0 A.D. manages to stand out as a comprehensive title and a very deep, tactical game despite being open sourc...
Gry Unity3D Tutorial
Unity3D Tutorial
Introduction to Unity 3D Unity 3D is a powerful game development engine. It is cross platform that is it allows you to create games for mobile, web, d...