Any way to download optional Cumulative & driver updates using Windows PowerShell?

Viewed 36

I am trying to write a package in PowerShell and batch that goes through a lot of the process to set up new computers that need to be set up to a basic readiness for computers using windows 10 & 11. Currently, the issue I'm having is getting the script to automatically start the optional windows updates.

The code I have currently starts the basic windows updates, but I can't quite figure out how to get it to start the optional updates.

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force

Install-Module PSWindowsUpdate -Force

Add-WUServiceManager -ServiceID "7971f918-a847-4430-9279-4a52d1efe18d" -Confirm:$false

Get-WindowsUpdate -AcceptAll -Install

Install-WindowsUpdate -Install -AcceptAll -UpdateType Driver -MicrosoftUpdate -ForceDownload -ForceInstall -IgnoreReboot -ErrorAction SilentlyContinue | Out-File "C:\Users\Public\Downloads\Drivers_Install_1_$(get-date -f dd-MM-yyyy).log"

Install-WindowsUpdate -Install -AcceptAll -UpdateType Software -MicrosoftUpdate -ForceDownload -ForceInstall -IgnoreReboot -ErrorAction SilentlyContinue | Out-File "C:\Users\Public\Downloads\Drivers_Install_1_$(get-date -f dd-MM-yyyy).log"
0 Answers
Related