Nintendo-Power

Daily Gaming news, videos, reviews, tips & guides. Let's share our love of BigN games!

This video tutorial shows you how to download, install, uninstall and display patches with PowerShell.

Control Windows Updates with PowerShell

Video-Tip # 50: Windows Update & Powershell Control Windows Updates with PowerShell

Windows 10 and Windows Server 2019/2022 provide the option to configure the installation and administration of updates with PowerShell. Microsoft has integrated the required module into the PowerShell on-board tool. In this video tutorial we will show you how to do it.

This video tutorial shows you how to download, install, uninstall and display patches with PowerShell.

(© Alexander Limbach – stock.adobe.com)

On current Windows 10 versions and Windows Server 2019/2022, you can manage updates through PowerShell without installing any additional module. Microsoft has integrated the required cmdlets into the “WindowsUpdateProvider” module. All cmdlets of the module are displayed with the following command:

Get-Command -Module WindowsUpdateProvider

In version 10 of Windows in 2004, Microsoft temporarily removed the module, but reintroduced cmdlets in later versions. This module will continue to be available on Windows Server 2019/2022. The module’s cmdlets also work with Microsoft’s update servers and WSUS.

How to download, install, uninstall and display patches with PowerShell is shown here in the video tip and gallery.

Gallery

Gallery with 5 images

By integrating cmdlets into standard PowerShell modules in Windows 10 and Windows Server 2019/2022, no additional installation of the module is required. Although the module currently sends only a few cmdlets, it is expected that Microsoft will integrate more cmdlets here. This module is the official part of PowerShell and is officially supported by Windows 10 and Windows Server 2019/2022 and newer.

Anyone who uses an unsupported module from a third-party manufacturer will not receive any support from Microsoft. The module provides “PSWindowsUpdate” The performance of Microsoft MVP Michal Gajda is significantly higher than that of “WindowsUpdateProvider”. The use of cmdlets on newly installed servers and servers on core servers with Windows Server 2019/2022 makes sense.

See also  Juventus, Stefano Daconi drop Ronaldo and punch Thibala

Download and install Windows Updates on PowerShell

Helps to create integration scripts for Windows Update Control in PowerShell and integrate the update installation into various login scripts. For example, you can save updates to a variable and start the installation based on these variables. Updates are saved, for example, with the following command:

$Updates = Start-WUScan -SearchCriteria "IsInstalled=0 AND IsHidden=0 AND IsAssigned=1"Write-Host "Updates found: " $Updates.Count

“Right-host” shows the number of updates found in the PowerShell session. This is definitely optional only. The actual installation then takes place:

Install-WUUpdates -Updates $Updates

The “-download only” parameter only downloads updates. The “Start-WUScan” cmdlet will search for updates to install updates on the system and then display them. “Start-WUScan” uses the saved source as a source in the guidelines. It could be Microsoft Update Server, but it could also be WSUS. If no restrictions are set with “Start-WUScan”, all available updates will be displayed.

How to download, install, uninstall and display patches with PowerShell is shown here in the video tip and gallery.

Gallery

Gallery with 5 images

The module can be used to investigate issues and analyze the update history of servers and workstations. Two cmdlets are available for this purpose: “Get-WULastInstallationDate” and “Get-WULastScanSuccessDate”. Both cmdlets can be used to check when the server last checked for updates and when updates were installed. “Get-WUIsPendingReboot” is used to verify that the restart is saved on the system triggered by updates. If this happens, you can restart the server with a “restart-system” before updates are installed.

See also  Outer Riders: Empty inventory issue takes precedence and first fix is ​​used Xbox One

Unfortunately, cmdlets do not support the “-Computername” parameter. Use the classic cmdlet “Invoke-Command” to request updates from computers on the network. With this, cmdlets can be executed on remote computers via the network.

Use the additional module PSWindowsUpdate

If the standard functions of the “WindowsUpdateProvider” module are not sufficient, you can use the third-party module “PSWindowsUpdate” in parallel. This can be installed in parallel. Command to do this:

Install-Module -Name PSWindowsUpdate -Force

The volume cmdlets of the module are displayed with the following command:

Get-Command -Module PSWindowsUpdate

The installed version of the module is marked with the following command:

Get-Package -Name PSWindowsUpdate

If you have a newer version of the module, you can install it with the following command:

Update-Module -Name PSWindowsUpdate -Force

Additional module “PSWindowsUpdate” provides additional options and displays additional information. Any connection issues will be displayed better than the graphical user interface and the “WindowsUpdateProvider” module. For example, to search for new updates through “PSWindowsUpdate” the following command is used:

Get-WindowsUpdate -MicrosoftUpdate -Verbose

The following command is available to automatically install all found links:

Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot

How to download, install, uninstall and display patches with PowerShell is shown here in the video tip and gallery.

Gallery

Gallery with 5 images

(ID: 47907645)