Difference between revisions of "Windows Update Powershell Commands"

From DFWLPiki
Jump to: navigation, search
Line 1: Line 1:
 
[[Category:Windows]]
 
[[Category:Windows]]
 
'''The PSWindowsUpdate set of commands is required.'''
 
'''The PSWindowsUpdate set of commands is required.'''
 +
If necessary, remove the older module with admin command promt:
 +
@RD /S /Q  C:\windows\system32\WindowsPowerShell\v1.0\Modules\PSWindowsUpdate\
  
 
Install the PSWindowsUpdate module:
 
Install the PSWindowsUpdate module:
  Install-Module -Name PSWindowsUpdate –Force
+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
 +
  Install-Module -Name PSWindowsUpdate -Confirm:$false -Force
  
 
Apply all available updates:
 
Apply all available updates:
Line 13: Line 16:
 
Show Updates sources and which is default (Desired state is usually "true" for Windows Server Update Service)
 
Show Updates sources and which is default (Desired state is usually "true" for Windows Server Update Service)
 
  Get-WUServiceManager
 
  Get-WUServiceManager
 +
 +
Show all available commands:
 +
Get-Command -module PSWindowsUpdate

Revision as of 20:17, 10 April 2020

The PSWindowsUpdate set of commands is required. If necessary, remove the older module with admin command promt:

@RD /S /Q  C:\windows\system32\WindowsPowerShell\v1.0\Modules\PSWindowsUpdate\

Install the PSWindowsUpdate module:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-Module -Name PSWindowsUpdate -Confirm:$false -Force

Apply all available updates:

Install-WindowsUpdate -AcceptAll

List all available updates

Get-WUList

Show Updates sources and which is default (Desired state is usually "true" for Windows Server Update Service)

Get-WUServiceManager

Show all available commands:

Get-Command -module PSWindowsUpdate