PowerShell Genie

Windows Update PowerShell commands: inventory and checks

Lesson 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

An example to inspect

Preview the example. Sign in for the full lesson and activities.

Get-HotFix | Select-Object HotFixID, InstalledOn
Inspect this example’s structure

Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.

Get-HotFix | Select-Object HotFixID, InstalledOn
  1. Stage 1Get-HotFixPositional values or no named parameters
  2. Stage 2Select-ObjectPositional values or no named parameters

    Inspect a sample

    1PS> Get-HotFix | Select-Object HotFixID, InstalledOn

    Example reader

    Inspect this page's example

    Fictional browser data when supported

    Run supported commands against the practice data, or inspect the example without executing it.

    Ready to inspect.

      Show reference output
      1 HotFixID InstalledOn
      2 --------- -----------
      3 KB5039217 9/6/2026
      4 KB5040442 8/28/2026

      Understand inventory coverage

      Get-HotFix queries Win32_QuickFixEngineering and is not a complete inventory of every installer or update mechanism. A missing KB in this result is a reason to inspect the relevant servicing source, not immediate proof that the fix is absent.

      Separate discovery from installation

      Installed history, available updates and pending restart state answer different questions. Define the target machine, servicing source and collection time in the report. Validate a known update on one machine before applying the query to a fleet.

      Evaluate PSWindowsUpdate deliberately

      PSWindowsUpdate is a separately maintained module, not a built-in PowerShell engine feature. Review its publisher, package version, help and organizational approval before installation. Use discovery operations first; commands that accept or install updates require a maintenance and restart plan.

      Account for managed environments

      WSUS, Windows Update for Business and device-management policy can control update availability. A local query or command does not replace those policies. Use the supported management workflow and examine policy or connectivity failures before attempting to override configuration.

      Confirm outcome after maintenance

      Check installation status in the appropriate source, reboot when the maintenance plan requires it, and validate the application. A single registry reboot indicator cannot establish that every Windows component is free of pending restarts.

      Command-line reference

      1PS> Get-HotFix -Id KB5034770 -ErrorAction SilentlyContinue
      2PS> # Inspect installed module help before choosing any update operation:
      3PS> Get-Module -ListAvailable PSWindowsUpdate

      The code above is a reference for your own authorized environment. The Run sample button shows only the stored fictional inspection result.

      Read the original documentation

      Get-HotFix reference · PSWindowsUpdate package

      Primary documentation

      Windows services and processes documentation

      Keep going

      Next: PowerShell Active Directory module
      Genie guideWindows Update PowerShell commands: inventory and checks

      Preview the example. Sign in for the full lesson and activities.