---
title: "Getting Started with PowerShell and the PSWindowsUpdate Module"
description: "Learn how to manage Windows updates in PowerShell with the PSWindowsUpdate module in this tutorial! Learn how to download and install updates on your Windows machine through PowerShell."
canonical: "https://adamtheautomator.com/pswindowsupdate/"
---

# Getting Started with PowerShell and the PSWindowsUpdate Module

> Learn how to manage Windows updates in PowerShell with the PSWindowsUpdate module in this tutorial! Learn how to download and install updates on your Windows machine through PowerShell.

Source: https://adamtheautomator.com/pswindowsupdate/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Getting Started with PowerShell and the PSWindowsUpdate Module](https://adamtheautomator.com/wp-content/uploads/2021/09/Getting-Started-with-PowerShell-and-the-PSWindowsUpdate-Module-.jpg)

# Getting Started with PowerShell and the PSWindowsUpdate Module

[![](https://secure.gravatar.com/avatar/d7af82363022947ce49ba2d0ec3b9470f7797b2541539ad2765a998a9c70c65c?s=192&d=mm&r=g)Ekekenta Clara](https://adamtheautomator.com/author/ekekenta-clara/)21 September 20215 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Installing the PSWindowsUpdate Module](#installing-the-pswindowsupdate-module)
*   [Checking for Available Windows Updates](#checking-for-available-windows-updates)
*   [Excluding Windows Updates from Installing](#excluding-windows-updates-from-installing)
*   [Installing Windows Updates](#installing-windows-updates)
*   [Downloading and Installing All Available Updates](#downloading-and-installing-all-available-updates)
*   [Checking Windows Update History](#checking-windows-update-history)
*   [Uninstalling Windows Updates](#uninstalling-windows-updates)
*   [Conclusion](#conclusion)

Installing Windows Updates manually can be a drag. Why not automate the entire process with PowerShell? Get started controlling Windows updates with the PSWindowsUpdate module in PowerShell!

In this tutorial, you will learn how to download and install updates on your Windows machine through PowerShell.

> _A FREE read only tool that scans your AD and generates multiple interactive reports for you to measure the effectiveness of your password policies against a brute-force attack. [Download Specops Password Auditor now!](https://specopssoft.com/contact-us/?utm_source=ata&utm_medium=referral&utm_campaign=na_ata&utm_content=mention)_

## Prerequisites

This tutorial uses Windows 10 Build 19042 for demonstrations throughout this tutorial, but older ones, such as Windows 7 and 8.1, will work.

## Installing the PSWindowsUpdate Module

The [PSWindowsUpdate](https://www.powershellgallery.com/packages/PSWindowsUpdate/2.2.0.2) module is a third-party module available in [PowerShell Gallery](https://www.powershellgallery.com/) that lets you manage Windows updates from the PowerShell console. The PowerShell Gallery is the central repository where you can find and share PowerShell modules.

With the PSWindowsUpdate module, you can remotely check, install, update and remove updates on Windows servers and workstations. But first, you need to install the PSWindowsUpdate module on your machine.

1\. Open [PowerShell as administrator](https://adamtheautomator.com/powershell-run-as-administrator/).

2\. Run the [`Install-Module`](https://docs.microsoft.com/en-us/powershell/module/powershellget/install-module?view=powershell-7.1) command to download and install the `PSWindowUpdate` module from the PowerShell gallery repository. The `-Force` parameter tells the command to ignore prompt messages and continue installing the module.

```powershell
Install-Module -Name PSWindowsUpdate -Force
```

> _If you’re on an older version of Windows, you can download the [PSWindowsUpdate module manually](https://docs.microsoft.com/en-us/powershell/scripting/gallery/how-to/working-with-packages/manual-download?view=powershell-7)._

3\. Next, run the [`Import-Module`](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/import-module?view=powershell-7.1) command below to import the `PSWindowsUpdate` module to PowerShell’s current session. Once imported, you can then use the module to manage Windows updates on your machine.

> _You may run into an error importing the module for the first time saying “The specified module ‘PSWindowsUpdate’ was not loaded”. In that case, you must [allow executing scripts](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.1) [](https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7.1)on your machine._
> 
> _Run the command `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned` to enable execute remote scripts on your computer. Now try importing the `PSWindowsUpdate` module again._

```powershell
Import-Module PSWindowsUpdate
```

4\. Finally, run the command below to see all commands ([`Get-Command`](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/get-command?view=powershell-7.1)) available for the `PSWindowsUpdate` module. Some of these commands are what you will use to manage Windows updates on your machine. `Get-Command -Module PSWindowsUpdate`

```powershell
Get-Command -Module PSWindowsUpdate
```

## Checking for Available Windows Updates

With the PSWindowsUpdate module installed, you can now run a command to list the updates available for your computer before installing them. Checking the list of updates is a good practice to avoid installing an update you don’t need.

Run the `Get-WindowsUpdate` command to list all the Windows updates

```powershell
Get-WindowsUpdate
```

Below, you can see the list of available Windows updates along with their Knowledge-Base (KB) numbers. Take note of any KB number of a Windows update that you may want to prevent installing later, perhaps one that you deem not important.

![Listing Available Windows Updates](https://adamtheautomator.com/wp-content/uploads/2021/09/image-168.png)

Listing Available Windows Updates

Perhaps you also want to check where Windows gets an update from to see if the source is trustworthy. If so, the `Get-WUServiceManager` command will do the trick.

Run the `Get-WUServiceManager` to show the list of available update services.

```javascript
Get-WUServiceManager
```

There’s no official documentation about the update the sources, but each is defined below:

*   **Microsoft Update** – the standard update source
*   **DCat Flighting Prod** – an alternative MS supdate ource for specific flighted update items (from previews, etc)
*   **Windows Store (DCat Prod)** – normally just Windows Store, but has Dcat Prod when for insider preview PC
*   **Windows Update** – an older update source for Windows Vista and older Windows OS.

![Showing where Windows Gets Updates](https://adamtheautomator.com/wp-content/uploads/2021/09/image-169.png)

Showing where Windows Gets Updates

## Excluding Windows Updates from Installing

Now you’ve seen the Windows updates available, perhaps you prefer not to install some of them on your computer. In that case, you can choose not to install them by hiding them.

Run the `Hide-WindowsUpdate` command below to hide a Windows update tagged with the specified KB number (`-KBArticleID KB4052623`). You can specify the KB number you took note of in the “Checking for Available Windows Updates” section instead.

PowerShell will ask for your confirmation before executing the command. Confirm the command with the “A” key, then press Enter.

```powershell
	Hide-WindowsUpdate -KBArticleID KB4052623
```

![Hiding an Update Based on the Update's KB Number](https://adamtheautomator.com/wp-content/uploads/2021/09/image-170.png)

Hiding an Update Based on the Update’s KB Number

> _If you change your mind and want to install the update in the future, you can show the update similar to how you hid the update. To show the update, run the `Show-WindowsUpdate` command along with the update’s KB number, like this: `Show-WindowsUpdate -KBArticleID KB4052623`_

## Installing Windows Updates

Now that you can discover and exclude some updates from installing, let’s now check out how to install them.

But before installing updates, checking if updates require a system reboot is a good practice. Why? Knowing whether the Windows updates require a reboot beforehand tells you to save all your work and complete other ongoing installations before diving to the Windows update.

Now run the `Get-WURebootStatus` command to determine if any of the Windows updates require a reboot. The command returns either `True` or `False` value to indicate the reboot status

```powershell
 Get-WURebootStatus
```

Below, you can see the command returned a **False** value, which indicates a reboot is not required. So go nuts and install the updates you deem are necessary.

![Checking if Reboot is Required After Installing Windows Updates](https://adamtheautomator.com/wp-content/uploads/2021/09/image-171.png)

Checking if Reboot is Required After Installing Windows Updates

Related:[How to Check for a Pending Reboot in the Registry (Windows)](https://adamtheautomator.com/pending-reboot-registry/)

### Downloading and Installing All Available Updates

If you’re not picky when it comes to updates, running the `Install-WindowsUpdate` command on its own lets you install all available Windows updates. But perhaps, you want to install the updates without having to accept prompts. If so, you need to add the `-AcceptAll` parameter as shown below.

Run the `Install-WindowsUpdate` command below to install all available Windows updates. The `-AcceptAll` parameter tells the command to suppress prompts and continue installing all updates.

If you prefer to reboot your computer once the installation is completed automatically, add the `-AutoReboot` parameter.

```javascript
Install-WindowsUpdate -AcceptAll -AutoReboot
```

![Installing All Windows Updates](https://adamtheautomator.com/wp-content/uploads/2021/09/image-172.png)

Installing All Windows Updates

> _If you prefer to install selected updates only, add the `-KBArticleID` parameter in the `Install-WindowsUpdate` command, followed by the update’s KB number, like this: `Install-WindowsUpdate -KBArticleID KB2267602`_

## Checking Windows Update History

Now you have installed windows updates on your computer, but perhaps something has gone wrong during the installation. If so, you can check your update history using the `Get-WUHistory` command. The `Get-WUHistory` prints out all the installed updates to the console with their installation result.

Run the `Get-WUHistory` command below to check Windows update history.

```powershell
Get-WUHistory
```

Below, you can see that most of the updates have the **Succeeded** result status, while some have **InProgress** status.

![Viewing Windows Update History](https://adamtheautomator.com/wp-content/uploads/2021/09/image-173.png)

Viewing Windows Update History

## Uninstalling Windows Updates

There are times when you install an update you don’t deem important at the moment, or there are updates you suspect of causing an issue on your system. In those times, you can properly uninstall the updates with the `Remove-WindowsUpdate` command.

Run the `Remove-WindowsUpdate` command below to uninstall a Windows update tagged with a specific KB number (`-KBArticleID KB2267602`).

PowerShell will require confirmation before executing the command. Press the “A” key and hit enter to confirm the command.

```powershell
Remove-WindowsUpdate -KBArticleID KB2267602
```

![Uninstalling Windows Updates](https://adamtheautomator.com/wp-content/uploads/2021/09/image-174.png)

Uninstalling Windows Updates

> _Enforce compliance requirements, block over 3 billion compromised passwords, and help users create stronger passwords in Active Directory with dynamic end-user feedback. [Contact us today about Specops Password Policy!](https://specopssoft.com/contact-us/?utm_source=ata&utm_medium=referral&utm_campaign=na_ata&utm_content=mention)_

## Conclusion

Throughout this tutorial, you’ve learned about the PSWindowsUpdate Module. You’ve also gone through selectively installing and uninstalling Windows updates.

You’ve learned that you have full control over the Windows updates with PowerShell. Now, would you prefer installing updates in PowerShell over a GUI method? Perhaps learn more about building a Windows update report?

Related:[How to Build a Basic PowerShell Windows Updates Report](https://adamtheautomator.com/powershell-windows-update/)

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpswindowsupdate%2F&text=Getting%20Started%20with%20PowerShell%20and%20the%20PSWindowsUpdate%20Module)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpswindowsupdate%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpswindowsupdate%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26995-troubleshoot-dns-issues-powershell-codex.webp)

### [Troubleshoot DNS Issues with PowerShell](/troubleshoot-dns-issues-powershell/)

Troubleshoot DNS issues with PowerShell by testing name resolution, DNS client settings, cache entries, and network connectivity in a repeatable workflow.

![](https://adamtheautomator.com/wp-content/uploads/2025/10/image_2025-10-24_095322075.png)

### [Migrating from PowerShell 6 to 7.5: Breaking Changes/New Features](/migrating-powershell-6-to-7-5/)

Migrate from PowerShell Core 6 to 7.5: breaking changes, features, and testing tips.

![](https://adamtheautomator.com/wp-content/uploads/2025/06/featured-image-6.png)

### [How to Add Timeouts to Pester Tests with PowerShell Runspaces](/pester-test-timeout-runspaces/)

Prevent Pester tests from hanging indefinitely using PowerShell runspaces. Learn to handle variable scoping, module loading, TestDrive access, and stream capture challenges with timeout protection.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
