Using the following package PSWindowsUpdate you can Get-WindowsUpdate and Install-WindowsUpdate.
install-module pswindowsupdate
DESCRIPTION
Use Get-WindowsUpdate (aka Get-WUList) cmdlet to get list of available or installed updates meeting specific
criteria.
Use Download-WindowsUpdate alias to get list of updates and download it. Equivalent Get-WindowsUpdate -Download.
Use Install-WindowsUpdate (aka Get-WUInstall) alias to get list of updates and install it. Equivalent
Get-WindowsUpdate -Install.
Use Hide-WindowsUpdate alias to get list of updates and hide it. Equivalent Get-WindowsUpdate -Hide.
Use Show-WindowsUpdate (aka UnHide-WindowsUpdate) alias to get list of updates and unhide it. Equivalent
Get-WindowsUpdate -Hide:$false.
There are two types of filtering update: Pre search criteria, Post search criteria.
- Pre search works on server side, like example: (IsInstalled = 0 and IsHidden = 0 and CategoryIds contains
'0fa1201d-4330-4fa8-8ae9-b877473b6441' )
- Post search work on client side after get the pre-filtered list of updates, like example $KBArticleID -match
$Update.KBArticleIDs
Status info list:\r\n[A|R]DIMHUB\r\nA-IsAccetped\r\nR-IsRejected\r\n D-IsDownloaded\r\n F-DownloadFailed\r\n
?-IsInvoked\r\n I-IsInstalled\r\n F-InstallFailed\r\n ?-IsInvoked\r\n R-RebootRequired\r\n M-IsMandatory\r\n
H-IsHidden\r\n U-IsUninstallable\r\n B-IsBeta