Check for Windows Updates via PowerShell [Guide]

Posted by

Keeping Windows up to date is one of the easiest ways to protect your PC, fix known issues, and improve system performance. Microsoft regularly releases Windows updates that include security patches, bug fixes, driver updates, and other improvements. Although you can check for updates through the Settings app, PowerShell offers another way to manage the process using commands.

If you prefer working with command-line tools or want to check for updates without navigating through multiple menus, PowerShell can be a useful option. You can use it to inspect your system, install the required update module, search for available updates, and, in supported configurations, install them directly from the command line.

However, there is one important detail to understand: Windows PowerShell does not provide a universal command that lists every available Windows Update on every computer. The commands you can use depend on your Windows version, installed modules, update policies, and permissions.

In this guide, you’ll learn how to check for Windows updates via PowerShell, understand the commands involved, and troubleshoot common problems along the way. 

Check for Windows Updates via PowerShell

Check for Windows Updates via PowerShell
Check for Windows Updates via PowerShell

To check for Windows updates using PowerShell;

  1. Open the Start menu and search for PowerShell.
  2. Select Run as administrator and approve the User Account Control prompt.
  3. Check your Windows version by running Get-ComputerInfo.
  4. Check whether the PSWindowsUpdate module is available by running Get-Module -ListAvailable PSWindowsUpdate.
  5. If necessary, install the module with Install-Module PSWindowsUpdate -Scope CurrentUser.
  6. Import the module using Import-Module PSWindowsUpdate.
  7. Search for available updates by running Get-WindowsUpdate.
  8. Review the results before deciding whether to install any updates.

These steps use the community-maintained PSWindowsUpdate module. It is not included with every Windows installation, so you may need to install it first.

If your computer is managed by an organization, its update policies may also affect which updates appear.

Step 1: Open PowerShell as an Administrator

First, open PowerShell with the permissions needed to perform system-level update operations. While some commands work without administrator access, running an elevated session helps avoid permission problems when managing Windows updates.

Click the Start button or press the Windows key on your keyboard. Type PowerShell in the search box. When Windows PowerShell appears in the results, select Run as administrator. If Windows displays a User Account Control prompt, choose Yes if you have permission to make changes to the computer.

A PowerShell window will open. Depending on your Windows configuration, you may see a blue or black terminal window. You can use either Windows PowerShell or a compatible PowerShell session for the commands in this guide.

Step 2: Check Your Windows Version

Before checking for updates, confirm which version of Windows you’re running. This information can help you troubleshoot compatibility problems and determine whether a particular update applies to your system.

In the PowerShell window, enter the following command and press Enter:

Get-ComputerInfo

PowerShell will display information about your computer, including the operating system name, version, and build number. Look for properties such as WindowsProductName, WindowsVersion, and OsBuildNumber.

The command may return a large amount of information, so you can use a shorter command if you only need the main Windows details:

Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, OsBuildNumber

This displays the selected properties in a more readable format. Knowing your Windows version is especially useful when an update fails to appear or a troubleshooting guide refers to a specific Windows release.

Step 3: Check Whether the PSWindowsUpdate Module Is Installed

To search for updates using the Get-WindowsUpdate command, you can use the PSWindowsUpdate module. This module adds commands for checking, installing, and managing Windows updates.

Before installing anything, check whether the module is already available. Enter:

Get-Module -ListAvailable PSWindowsUpdate

Press Enter and review the output. If PowerShell lists the module and its version, it is available on your computer. If the command returns no results, the module may not be installed or may not be available in the module search paths.

Remember that this module is maintained separately from Windows itself. You do not need to install it if you prefer to use the Windows Settings app or another update-management method.

Step 4: Install the PSWindowsUpdate Module

If the module is missing, you can install it from the PowerShell Gallery, provided your computer has internet access and your security policies allow the installation.

Run the following command:

Install-Module PSWindowsUpdate -Scope CurrentUser

The CurrentUser scope installs the module for your Windows user account instead of making it available to every user on the computer. This is a convenient choice if you do not need a system-wide installation.

If PowerShell asks whether you want to install a provider or trust the repository, review the prompt before confirming. Only proceed if you are comfortable using the PowerShell Gallery and your organization’s policies permit it.

If you receive an error related to TLS, repository access, or execution policy, don’t immediately change security settings. First, check your internet connection, PowerShell version, and organizational restrictions. Avoid disabling security protections simply to force the installation.

Step 5: Import the Module into PowerShell

Once the module is installed, load it into your current PowerShell session. Enter:

Import-Module PSWindowsUpdate

Press Enter to run the command. If it completes without displaying an error, the module should be available in the session.

You can verify that its commands are available by running:

Get-Command -Module PSWindowsUpdate

PowerShell will display commands provided by the module. Look for Get-WindowsUpdate, which is the main command you’ll use to search for available updates.

If PowerShell reports that the module cannot be found, confirm that installation completed successfully. You can also close the current terminal, reopen PowerShell, and import the module again.

Step 6: Check for Available Windows Updates

Now you’re ready to search for updates. Run this command:

Get-WindowsUpdate

Press Enter and allow PowerShell to complete the search. Depending on your computer and update configuration, the process may take a little time.

If updates are found, the output can include details such as the update title, KB article number, size, and status. A KB number identifies a Microsoft Knowledge Base article associated with an update. You can use it to identify a specific update when troubleshooting installation problems.

If no updates appear, it does not necessarily mean your computer is missing updates. Your system may already be up to date, the applicable updates may not be offered to your device, or an update policy may restrict what is available.

Keep in mind that Get-WindowsUpdate searches through the module’s update-management mechanism. The results can vary depending on your Windows Update configuration and the update source used by your computer.

Step 7: Display the Update Results More Clearly

If you want a cleaner view of the available updates, you can select the most useful properties instead of displaying every available field.

Run:

Get-WindowsUpdate | Format-Table -AutoSize

This presents the returned results in a table, making it easier to compare update titles and other available information.

You can also save the results to a variable for further inspection during the current session:

$Updates = Get-WindowsUpdate

Then display the stored results by entering:

$Updates

This approach is useful when you want to review the results before deciding what to do next. The variable only stores the results in the current PowerShell session. It does not install updates or create a permanent report.

Step 8: Install Updates After Reviewing Them

Checking for updates and installing updates are two different tasks. The Get-WindowsUpdate command searches for updates, while installation requires an additional command.

If you have reviewed the available updates and want to install them, you can run:

Install-WindowsUpdate

The command may ask for confirmation before proceeding. Read the displayed information carefully and confirm only when you’re ready.

If you want PowerShell to ask for confirmation before installing each applicable update, you can use:

Install-WindowsUpdate -Confirm

Some updates require a restart to finish installation. Save your work and close important applications before allowing a restart.

For additional control, you can target a particular update by its KB number using the module’s supported filtering options. Check the command’s help with Get-Help Install-WindowsUpdate -Full before using more specific parameters.

Important: Do not install every available update automatically on a work-critical computer without reviewing the update list and following your organization’s change-management requirements.

Step 9: Verify the Update Status

After the installation process finishes, check the update status again. Run:

Get-WindowsUpdate

This can help you determine whether updates are still being offered. However, some updates may not appear in the same way after installation, and a pending restart can affect their final status.

You can also check Windows’ update history by opening Settings and navigating to Windows Update > Update history. The page lists installed updates and can help you identify whether a particular update completed successfully.

If Windows asks you to restart the computer, save your work and restart when convenient. After restarting, return to the update history or run another update check to confirm the system’s status.

FAQs

Can I check for Windows updates using PowerShell without installing a module?

Yes, but the options are more limited. Windows includes update-management components and APIs, but there is no single universal PowerShell command that reliably lists all available updates on every Windows configuration. The PSWindowsUpdate module is a common option for command-line update checks.

Why does Get-WindowsUpdate say the command is not recognized?

This usually means the PSWindowsUpdate module is not installed, has not been imported, or is not available in the current PowerShell session. Check its installation using Get-Module -ListAvailable PSWindowsUpdate, then run Import-Module PSWindowsUpdate if necessary.

Do I need administrator privileges to check for updates?

Some update queries can work without elevation, but installing updates and performing system-level operations may require administrator privileges. Running PowerShell as an administrator can help prevent permission-related errors.

Is PSWindowsUpdate safe to use?

PSWindowsUpdate is a community-maintained module commonly used to manage Windows updates. Download it from the PowerShell Gallery, review the package and its publisher information, and follow your organization’s security policies. As with any third-party module, only install software you trust.

Why are no Windows updates showing in PowerShell?

Your PC may already be up to date, or no applicable updates may currently be offered. Your organization may also control updates through Windows Update for Business, WSUS, or another management service. Compare the results with Settings > Windows Update and check whether a restart is pending.

Can PowerShell install Windows updates automatically?

Yes. With an appropriate update-management method, PowerShell can install updates and support automation. However, automatic installation should be configured carefully because some updates require restarts and can affect applications or business operations.

Final Words

Checking for Windows updates through PowerShell is a practical option if you prefer command-line tools or want more control over update management. By using the PSWindowsUpdate module, you can search for available updates, review their details, and install selected updates without navigating through the Settings app for every task.

For beginners, the best approach is to start with Get-WindowsUpdate, review the results, and install updates only after understanding what they contain. If the module is unavailable or your system is managed by an organization, use the approved update method for your computer.

Most importantly, keep your PC updated, save your work before installing updates, and restart when required.

Leave a Reply

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