When Windows Server 2016 was introduced a very nice CIM class was provided to work with Windows Updates. If you wanted to scan for available updates you could do something like this:
$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate… Read the full text.