Pre-req steps for windows update using powershell:
netsh winhttp set proxy "xxxxxxx:80" # use proxy if any
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Install-PackageProvider -Name NuGet
Install-Module PSWindowsUpdate
Add-WUServiceManager -MicrosoftUpdate
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot | Out-File "D:\MSUpdates.log" -Force