Run Windows Update from powershell

powershell -command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force}; Install-Module -Name PSWindowsUpdate -Force"

Get-WindowsUpdate

powershell -command "& {Install-WindowsUpdate -AcceptAll -AutoReboot}"

Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot