Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell - Install Windows Updates?

Is this possible?

I guess we would need to invoke the WUAgent somehow to run a detection, but I would like to essentially download and install updates, then reboot as part of the script.

This will be part of a larger script to basically build a vanilla 2008R2 box up to a DC all through Powershell.

like image 849
PnP Avatar asked Mar 02 '13 13:03

PnP


People also ask

How do I install Windows updates from command line?

Step 1: Type cmd in the search box next to Cortana, and right-click the top one, then choose Run as administrator and click Yes to continue. Step 2: Type UsoClient StartScan to check for updates. Step 3: Type UsoClient StartDownload to download updates.

Does PowerShell update with Windows updates?

The Microsoft Update feature of PowerShell allows you to get the latest PowerShell 7 updates in your traditional Microsoft Update (MU) management flow, whether that's with Windows Update for Business, WSUS, Microsoft Endpoint Configuration Manager, or the interactive MU dialog in Settings.

How do I force a Windows Update to install?

The latest Windows update is Windows 11, version 22H2, also known as the Windows 11 2022 Update. Also, note the following: To check for updates, select Start > Settings > Windows Update , then select Check for updates. If updates are available, you can choose to install them.


1 Answers

Take a look at the PSWindowsUpdate module for PowerShell.

It is located here at the Script Center

like image 97
Frode F. Avatar answered Nov 15 '22 08:11

Frode F.