Windows Update PowerShell Generator

Generate Windows Update PowerShell commands for local or remote PCs. Scan, install, hide, uninstall, pause, or reboot using PSWindowsUpdate or usoclient.

Advertisement

Free Windows Update PowerShell Command Generator

Windows Update has accumulated three generations of command-line interfaces, and which one works depends on the Windows version in front of you. wuauclt was the answer on Windows 7 and Server 2012 and is mostly inert on Windows 10 and 11. usoclient replaced it, runs silently, and is barely documented. The PSWindowsUpdate PowerShell module is the only option that gives real output and manages remote machines properly — and it is not installed by default. This generator picks a working command for the action you want, on the platform you have, for local or remote targets, and chains several actions into one copy-paste script.

It generates text only. Nothing runs, no machine is contacted, and no credentials are involved. You copy the script, read it, and run it yourself in an elevated PowerShell window.

How to Use the Generator

  1. Choose an action. Check for updates, download, install, cancel a running update, view history, hide a KB, uninstall a KB, pause, resume, or reboot to finish.
  2. Choose local or remote. For remote, enter one or more computer names; the generator builds the correct Invoke-Command or Invoke-WUJob wrapper and lists the machines as a PowerShell array.
  3. Pick a method. Only the methods that actually support your chosen action are offered. Switching actions keeps your current method if it still applies and falls back to the recommended one if it does not.
  4. Set options. A KB number where the action needs one, driver inclusion, and auto-reboot behaviour appear only when the selected method supports them.
  5. Chain steps and copy. Add the current command as a step and build the next one. The assembled script carries a header stating whether it needs elevation, the PSWindowsUpdate module, or WinRM on the targets.

Elevation, Downtime, and What Each Command Costs You

Nine of the ten actions require an elevated PowerShell session — only viewing update history runs as a standard user. The generated script says so in its header when any step needs it, but it is worth being explicit about which commands change state and which can take a machine offline.

ActionNeeds adminOperational impact
Check for updatesYesRead-only scan. Safe at any time.
View historyNoRead-only query of installed hotfixes.
DownloadYesConsumes bandwidth and disk. No restart.
InstallYesMay restart the machine. With -AutoReboot it definitely will.
Cancel a running updateYesStops update services and cancels transfers. An update already installing will still finish on next boot.
Hide a KBYesConfiguration change; suppresses an update indefinitely until unhidden.
Uninstall a KBYesRemoves a patch, usually reopening whatever it fixed. Often requires a restart.
Pause / resumeYesWrites or removes a registry policy value. No restart.
Reboot to finishYesRestarts immediately, with no user warning and no grace period.

Two of these deserve a hard pause before you press enter. The reboot action emits Restart-Computer -Force, which restarts the machine immediately — anyone logged in loses unsaved work, and against a remote list it restarts every machine in that list at once. The generator prefixes those commands with an explicit warning comment for exactly that reason, and offers the -Wait -For PowerShell -Timeout 600 variant so a script can wait for each machine to come back before continuing. The uninstall action removes a security patch; if you are backing out a bad update, make sure you know what vulnerability the machine is exposed to again in the meantime, and plan to reinstall or replace it.

Method Reference

MethodWorks onNotes
PSWindowsUpdate moduleAny Windows with PowerShellMost control and visible output; the only method that manages remote computers natively. Requires Install-Module PSWindowsUpdate -Force first.
usoclientWindows 10/11, Server 2016+Built-in and modern, but runs silently with no output — check Settings > Windows Update to see what happened.
wuaucltWindows 7 / Server 2012Legacy. Largely non-functional on Windows 10 and 11; the generator labels it as such rather than pretending otherwise.
Built-in PowerShellAny WindowsGet-HotFix, wusa, Restart-Computer. No module install needed.
wmicAny Windows (deprecated in Win 11)Quick read-only listing of installed updates.
RegistryWindows 10/11Writes Windows Update policy values directly. Used for pause and resume.

Worked Examples

Install a specific patch locally without restarting. Choosing install, the PSWindowsUpdate method, KB5001234, and leaving auto-reboot off produces:

Install-WindowsUpdate -KBArticleID KB5001234 -AcceptAll -IgnoreReboot

-IgnoreReboot is what keeps the machine up; switch auto-reboot on and it becomes -AutoReboot, which restarts as soon as the install requires it.

Check what is available on three servers. Selecting remote targets wraps the scan in a job against a PowerShell array:

Get-WindowsUpdate -ComputerName @('SRV01','SRV02','SRV03')

Stop an update that is mid-flight. The cancel action produces a sequence rather than a single command: stop wuauserv, usosvc, and bits, remove every in-progress BITS transfer, then start the services again so future updates still work. The generated comments state the limitation plainly — an update already past the installing stage will complete on the next reboot regardless, and has to be uninstalled afterwards.

Pause updates for a change freeze. The pause action writes an expiry timestamp to HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings at a date you choose; resume removes that value and triggers a fresh scan.

Prerequisites for Remote Targets

Remote actions need PowerShell remoting enabled on each target, which means running Enable-PSRemoting -Force on the machine itself — a step you cannot bootstrap remotely with these commands. The generated script includes that reminder in its header whenever any step targets a remote computer.

The other constraint is specific to Windows Update: it will not install updates through a normal remote session, because the update agent refuses to run under a network logon token. That is why the PSWindowsUpdate method uses Invoke-WUJob, which registers a scheduled task on the target running as SYSTEM, rather than plain Invoke-Command. If a remote install appears to do nothing, this double-hop restriction is almost always the reason.

Frequently Asked Questions

Does this tool run any commands on my machines?

No. It assembles script text in your browser. Nothing executes, no host is contacted, and no credentials are collected. You copy the script and run it yourself, which gives you the chance to review it first.

Why does wuauclt /detectnow do nothing on Windows 11?

Because Microsoft replaced the Windows Update Agent’s command surface with the Update Session Orchestrator. On Windows 10 and 11 the old switches are accepted and ignored. Use usoclient or the PSWindowsUpdate module instead; the generator marks wuauclt as legacy for this reason.

I ran a usoclient command and nothing happened. Is it broken?

Probably not. usoclient returns immediately and does its work in the background with no console output. Open Settings > Windows Update to see the scan, download, or install progress.

How do I install the PSWindowsUpdate module?

Run Install-Module PSWindowsUpdate -Force from an elevated PowerShell session. It comes from the PowerShell Gallery, so the machine needs outbound access to it, and you may be prompted to trust the repository the first time.

Can I install updates on a remote computer with Invoke-Command?

Not reliably. The Windows Update agent blocks installs initiated over a remote session token. Invoke-WUJob works around this by scheduling a task that runs locally as SYSTEM, which is what the generator emits for remote installs.

What is the difference between hiding and uninstalling a KB?

Hiding prevents an update from being offered or installed in the first place — useful when a known-bad patch is pending. Uninstalling removes one that is already applied, which reintroduces whatever it fixed and often requires a restart. Hide before it lands, uninstall only when it already has.

Will the reboot action warn logged-in users?

No. Both Restart-Computer -Force and usoclient RestartDevice restart immediately with no countdown and no prompt. Unsaved work is lost. Schedule it, or use the -Wait variant in a controlled maintenance window.

How long can I pause updates?

Windows caps consumer pause at 35 days from the current date. Setting a longer expiry in the registry does not extend it — the setting is clamped. For longer or policy-driven deferrals, use Windows Update for Business policies or your patch management platform.

Which related tools help with the rest of a patch window?

The Exchange Online PowerShell command builder covers mailbox-side administration in the same style, and the MTBF/MTTR calculator helps quantify how much a reboot window actually costs in availability terms.

What Is Windows Update PowerShell

Windows Update PowerShell commands enable system administrators to manage Windows updates programmatically — querying available updates, installing patches, scheduling maintenance windows, and generating compliance reports across fleets of machines. While Windows Update settings can be configured through the GUI or Group Policy, PowerShell provides the automation capabilities needed for enterprise-scale patch management.

This tool generates PowerShell commands and scripts for common Windows Update operations, using the PSWindowsUpdate module and built-in Windows Update cmdlets.

Key PowerShell Modules

ModuleSourceUse Case
PSWindowsUpdatePowerShell GalleryFull-featured WU management (install, download, hide, report)
WindowsUpdateProviderBuilt-in (Server)Basic update scanning and installation on Windows Server
WSUS cmdletsRSAT featureManaging Windows Server Update Services infrastructure
Intune Graph APIMicrosoft GraphCloud-managed device update compliance via PowerShell

Common PSWindowsUpdate Commands

CommandPurpose
Get-WindowsUpdateList available updates
Install-WindowsUpdateDownload and install updates
Get-WUHistoryView update installation history
Hide-WindowsUpdateSuppress specific updates
Get-WUServiceManagerList configured update sources
Remove-WindowsUpdateUninstall specific updates

Common Use Cases

  • Patch compliance reporting: Generate reports showing which machines have pending updates, failed installations, or are out of compliance with patching SLAs
  • Automated patching: Script update installation during maintenance windows with automatic reboot scheduling and post-update verification
  • Selective update deployment: Install only security updates while deferring feature updates, or approve specific KB articles for installation
  • Remote management: Push updates to remote servers and workstations using PowerShell remoting (Invoke-Command) without RDP access
  • WSUS administration: Manage WSUS server configurations, approve updates, and generate compliance reports for on-premises update infrastructure

Best Practices

  1. Test updates in a staging environment first — Never deploy updates directly to production servers. Use a test group to verify updates do not cause application compatibility issues.
  2. Schedule maintenance windows — Install updates during defined maintenance windows. Use -ScheduleReboot to control when restarts occur and avoid business-hours disruptions.
  3. Use -WhatIf before installing — Preview which updates would be installed with -WhatIf before committing. This prevents unintended updates from being applied.
  4. Monitor for failed installations — Check Get-WUHistory after patching to identify failed updates. Failed security patches leave known vulnerabilities unpatched.
  5. Document exceptions — When updates are hidden or deferred, document the reason and set a review date. Permanently hidden security updates create unmanaged risk.
  6. Automate compliance reporting — Schedule weekly PowerShell scripts that scan all machines for missing updates and email results to the security team. Compliance visibility drives patching discipline.

Frequently Asked Questions

What is PSWindowsUpdate and how do I install it?+

PSWindowsUpdate is a PowerShell module that provides comprehensive Windows Update management. Install it with: Install-Module -Name PSWindowsUpdate -Force. It supports checking for updates, installing specific KBs, managing WSUS, and scheduling reboots.

What is the difference between usoclient and wuauclt?+

usoclient is the modern Update Session Orchestrator client introduced in Windows 10, while wuauclt is the legacy Windows Update AutoUpdate Client. Use usoclient for Windows 10/11 and wuauclt for older systems. usoclient commands include StartScan, StartDownload, and StartInstall.

How do I check Windows Update history with PowerShell?+

Use Get-WUHistory from PSWindowsUpdate module, or query WMI with Get-WmiObject -Class Win32_QuickFixEngineering. You can also use Get-HotFix for installed hotfixes and systeminfo with findstr KB for a quick list of installed KBs.

Can I uninstall Windows Updates with PowerShell?+

Yes, use Remove-WindowsUpdate -KBArticleID KB5001234 from PSWindowsUpdate, or wusa.exe /uninstall /kb:5001234 /quiet. You can also use DISM: dism /online /remove-package /packagename:Package_for_KB5001234. Always create a restore point first.

How do I run Windows Update on a remote computer?+

Use the Remote Computer(s) target in the Command Builder, or the Remote Computers presets. Enter the computer name or IP address and the tool generates the right command. For installs, the tool uses Invoke-WUJob from the PSWindowsUpdate module because Windows blocks direct remote update installs. Requirements: WinRM enabled on the target (Enable-PSRemoting -Force), administrator rights, and the PSWindowsUpdate module installed on the target machine.

This tool is provided for informational and educational purposes only. All processing happens in your browser — no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results.