Deploy-AvailableCumulativeUpdate
Overview
The Deploy-AvailableCumulativeUpdate.ps1
script automates the process of ensuring a Windows system is running the latest cumulative update (CU). It performs compatibility checks, repairs Windows Update functionality if necessary, and installs the latest CU while adhering to support lifecycle policies. This script is particularly useful for maintaining system security and stability by keeping Windows systems up-to-date.
Requirements
- PowerShell Version: Requires PowerShell 5.0 or later.
- Operating System: Windows 10 or higher.
- Administrative Privileges: The script must be run as an administrator.
- Internet Access: Required to download additional scripts and OS lifecycle information from remote repositories.
- Modules: The
Strapper
andPSWindowsUpdate
modules are required. The script ensures these are installed and up-to-date.
Dependencies
Process
- Compatibility Check: Verifies that the operating system is Windows 10 or higher.
- Preferences Configuration: Configures PowerShell preferences for silent operation and secure communication.
- Strapper Module Management: Ensures the
Strapper
module is installed and up-to-date. - Retrieve Latest Installed CU: Downloads and executes a script to retrieve information about the latest installed cumulative update.
- Retrieve OS Support End Date: Fetches OS lifecycle data to determine if the system is still supported.
- Windows Update Repair: Repairs Windows Update functionality if necessary.
- Install Latest CU: Checks for available cumulative updates and installs them if found.
- Reboot Handling: Reboots the system if the
-Reboot
parameter is specified or logs a message advising a manual reboot.
Payload Usage
The script can be executed with or without parameters depending on the desired functionality.
Example 1
Retrieve detailed information about the operating system and the latest installed cumulative update without performing any updates or repairs.
.\Deploy-AvailableCumulativeUpdate.ps1 -Get
Example 2
Install the latest cumulative update and reboot the system to complete the installation.
.\Deploy-AvailableCumulativeUpdate.ps1 -Reboot
Example 3
Install the latest cumulative update without rebooting the system.
.\Deploy-AvailableCumulativeUpdate.ps1
Parameters
Parameter | Alias | Required | Default | Type | Description |
---|---|---|---|---|---|
Get | False | Switch | Retrieves detailed information about the OS and the latest installed CU. | ||
Reboot | False | Switch | Reboots the system after installing the latest cumulative update. |
Output
- Deploy-AvailableCumulativeUpdate-log.txt
- Deploy-AvailableCumulativeUpdate-error.txt