PowerShell to install Microsoft Update Packages sequentially


PowerShell to install Microsoft Update Packages sequentially Update Windows 8.1 to Update 1 without waiting about to manually click each update.

This is a Quick Publish article; this means it probably doesn’t make much sense, but at least gets what I want to share out there

Update Windows 8.1 to Update 1 without waiting about to manually start each update.
Update Windows 8.1 to Update 1 without waiting about to manually start each update.

Due to Microsoft’s staggered approach to rolling out the Windows 8.1 Update globally via Windows Update, I got impatient waiting for it to arrive on my home PC after having it installed on my work PC for the last two weeks.

So I jumped on over to Microsoft’s Download Center where the Windows 8.1 Update 1 update packages are available. They have to be installed in a particular order, though.

Instead of waiting for each one to finish before running the next update package, I wrote some generic PowerShell that could be used for any set of MSUs that you wish to install in a row.

The PowerShell below obviously relates to the W8.1U1, but could be repurposed for anything just by updating the array containing the update (file) names.

$UpdatesToInstall = @(
	"Windows8.1-KB2919355-x64",
	"Windows8.1-KB2932046-x64",
	"Windows8.1-KB2959977-x64",
	"Windows8.1-KB2937592-x64",
	"Windows8.1-KB2938439-x64",
	"Windows8.1-KB2934018-x64"
);

$WusaArgs = @("/QUIET", "/NORESTART");

Foreach ($update in $UpdatesToInstall) {
	$args = @();
	$args += $update + ".msu";
	Foreach ($a in $WusaArgs) {
		$args += $a;
	}

	Write-Host ("Installing " + $update + "...") -NoNewLine;
	Start-Process "WUSA" $args -Wait
	Write-Host "done";
}

Geek, wanderluster, pochemuchka, wannabe-polyglot, photographer and UK-resident kiwi here for the travel.

One response on “PowerShell to install Microsoft Update Packages sequentially

Leave a Reply

Your email address will not be published. Required fields are marked *