- Overview
- Getting Started
- Features
- Configuration
- Requirements
- Credits
- Like to say thank you?
- References & Vendor Documentation
- License
Update My PC is a comprehensive PowerShell automation script designed to keep your Windows system, Microsoft Store apps, Microsoft Office, and other applications up to date. It is intended to be run either interactively, or as a scheduled task via Windows Task Scheduler to provide a hands-off approach to regular system maintenance and patching.
This is primarily for a home/own PC use case, or where you have a very small office environment and the work you do/data you handle is of a very low security risk.
Caution
Please use enterprise-grade methods of updating your Windows computers if you:
- Are handling Sensitive PII,
- Have serious audit responsibilities and accountablity around Information Security, such as ISO 27007/HIPAA/Sarbanes-Oxley Act (SOX)/PCI DSS/Graham-Leach-Bliley, etc.,
- Need to actually meet your obligations under a Cybersecurity insurance policy your organisation holds,
- Have other legal obligations that mean you can't afford to mess up, and/or
- Any other reasons that warrant being properly serious about your enterprise computing environment.
If you or your organisation fall into any of these categories - then you should be looking at, budgeting for, and resourcing, proper solutions for maintaining your PC's updates, patching and security. This script is simply not intended for you.
- Clone or Download this repository to your local machine.
- Review and Edit Configuration:
- Run the script interactively to use the setup wizard (needed to create the
WindowsUpdateConfig.jsonfile), or editWindowsUpdateConfig.jsondirectly if you already have one.
- Run the script interactively to use the setup wizard (needed to create the
- Run the Script interactively to configure:
- Right-click
WindowsUpdate.ps1and select "Run with PowerShell" (as Administrator), or execute from a PowerShell terminal. - Use the interactive menu to run updates, edit configuration, or set up scheduled tasks.
- When run interactively outside of an Administration terminal, you will be prompted via UAC to elevate your privledges
- Right-click
- Schedule Automatic Updates (optional):
- Use the script's first time setup, or configuration menu, to edit the config to enable and customise scheduled runs via Windows Task Scheduler.
- Updates your choice of supported software and components with a single script
- Configuration to choose which kinds or combination of top-level updates you want to run.
- Automated Windows Updates: Checks for and installs all available Windows updates, including security and feature updates.
- Microsoft Store App Updates: Updates Microsoft Store applications using
winget. - Microsoft Office Updates: Detects and updates Microsoft Office installations, closing running Office apps as needed.
- Third-Party App Updates: Optionally integrates with Patch My PC Home Updater to update a wide range of third-party applications.
- Configuration
- Configurable Update Types: Choose which update types to enable (Windows, Office, Winget, PatchMyPC), and any combination thereof, via a JSON config file or interactive menu.
- Winget Skip List: Exclude specific apps from being updated by
wingetusing a customizable skip list.
- First-Time Setup Wizard: Interactive setup for configuration, including scheduling, log management, and update preferences.
- Robust Logging: Logs all actions and results to a configurable directory, with retention and archiving options.
- Scheduled Task Support: Easily create or update a Windows Task Scheduler job to run the script automatically on a schedule (daily, weekly, or monthly).
- Auto-Elevation: Automatically relaunches itself with administrative privileges if required.
- Error Handling: Graceful error handling and informative log messages for troubleshooting.
All settings are stored in WindowsUpdateConfig.json. Key options include:
logDir: Directory for log files.wingetSkipList: List of app names or IDs to exclude fromwingetupdates.UpdateTypes: Which update types to enable (Windows,Office,Winget,PatchMyPC).ScheduledTask: Scheduling options for automated runs.
You can edit this file manually, or use the script's interactive menu.
- Windows 10/11
- PowerShell 5.1+ or PowerShell Core (pwsh)
- winget (Windows Package Manager)
- Patch My PC Home Updater (optional, can be installed by the script)
- Administrative privileges (required for most update operations)
- Author: Michael H (twcau) (License)
Feel welcome to:
- Windows Update Command-Line Reference
- Enable Script Execution Policy in PowerShell
- Microsoft Store App Updates
- Patch My PC Documentation
- Windows Package Manager (winget)
See the LICENSE file in the root of this repository for usage rights and licensing information.
This project is not affiliated with Microsoft or Patch My PC. Use at your own risk.