A comprehensive PowerShell script for automating system updates on Windows systems using multiple package managers (winget, Chocolatey) and Windows Update.
This repository contains PowerShell scripts for Windows system maintenance and software installation:
- Update-System.ps1: Automates the update process for Windows systems
- Install-DevTools.ps1: Installs specialized software for development, FPGA, gaming, and more
This script automates the update process for Windows systems by combining multiple update mechanisms into a single, convenient script:
- Windows package management with winget
- Software packages installed via Chocolatey
- Windows system updates using the PSWindowsUpdate module
The script includes robust error handling, detailed logging, and administrative privilege verification to ensure updates are properly applied.
This script provides an interactive and automated way to install specialized software in several categories:
- Development Tools: VS Code, Git, Python, Node.js, Visual Studio, Docker Desktop, etc.
- FPGA Tools: Xilinx Vivado, Intel Quartus, Yosys, NextPNR, etc.
- Gaming/Emulation Tools: RetroArch, Dolphin, PCSX2, RPCS3, Citra, etc.
- ROM Management Tools: LaunchBox, ROMCenter, ClrMamePro, Rufus, MAME Tools, SabreTools, RomVault, etc.
- Handheld Device Tools: Analogue Pocket Updater, Pocket Sync
- Supporting Tools: 7-Zip, DirectX, Visual C++ Redistributables, NVIDIA drivers, etc.
The script validates if the required package managers are installed, checks if packages are already installed before attempting installation, and provides detailed logs and summaries of all operations.
- Windows 10/11 operating system
- PowerShell 7.0 or higher (scripts will not work properly with Windows PowerShell 5.1)
- Administrator privileges (required for installation and updates)
- Package managers:
- winget (Windows Package Manager)
- Chocolatey (Optional for Update-System.ps1, but enables more packages in Install-DevTools.ps1)
- Internet connectivity
- For FPGA development: Sufficient disk space (20+ GB) for tools like Xilinx Vivado or Intel Quartus
- For Gaming/Emulation: A capable GPU for optimal performance
- For Handheld Device Tools: USB connectivity for device management
- Clone this repository:
git clone https://github.com/yourusername/windows-update-script.git cd windows-update-script
- Download the script file directly:
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/yourusername/windows-update-script/main/Update-System.ps1" -OutFile "$env:USERPROFILE\Update-System.ps1"
- Create a new PowerShell script file named
Update-System.ps1
- Copy the contents from Update-System.ps1 in this repository
- Save the file to a location of your choice
Run the script with administrative privileges:
# Navigate to the script location (if using the git clone method)
cd path\to\windows-update-script
# Run the script
.\Update-System.ps1
You can set up a scheduled task to run this script automatically:
- Open Task Scheduler
- Create a new task with these settings:
- Run with highest privileges
- Configure for: Windows 10 (or your version)
- Trigger: On a schedule (e.g., weekly)
- Action: Start a program
- Program/script:
powershell.exe
- Arguments:
-ExecutionPolicy Bypass -File "C:\path\to\Update-System.ps1"
- Program/script:
Run the script with administrative privileges to use the interactive menu:
# Navigate to the script location
cd path\to\windows-update-script
# Run the script with interactive menu
.\Install-DevTools.ps1
This will display a menu with the following options:
- Install Development Tools
- Install FPGA Tools
- Install Gaming/Emulation Tools
- Install ROM Management Tools
- Install Supporting Tools
- Install Handheld Device Tools
- Install All Categories
- Custom Installation (select individual packages)
You can also run the script with parameters for automated installation:
# Install all development tools
.\Install-DevTools.ps1 -DevTools
# Install FPGA and gaming tools
.\Install-DevTools.ps1 -FpgaTools -GamingTools
# Install all categories
.\Install-DevTools.ps1 -AllCategories
# Available parameters
# -DevTools : Install development tools
# -FpgaTools : Install FPGA development tools
# -GamingTools : Install gaming/emulation tools
# -RomTools : Install ROM management tools
# -SupportingTools : Install supporting tools
# -HandheldTools : Install handheld device management tools
# -AllCategories : Install all categories
# -NonInteractive : Run in non-interactive mode
- Administrative Privilege Check: Ensures the script is run with the proper permissions
- Multi-Package Manager Support:
- Windows Package Manager (winget)
- Chocolatey Package Manager
- Windows Update
- Comprehensive Logging: Detailed logs of all operations
- Creates timestamped log files in
%USERPROFILE%\Logs
- Color-coded console output
- Creates timestamped log files in
- Error Handling: Graceful handling of failures
- Update Summary: Provides a concise summary of update operations
- Interactive Menu System: Easy-to-use interface for selecting software to install
- Multi-Package Manager Support:
- Windows Package Manager (winget)
- Chocolatey Package Manager
- Specialized Software Categories:
- Development tools for programmers
- FPGA development tools
- Gaming and emulation software
- ROM management utilities
- Handheld device management tools
- Supporting system tools
- Smart Installation:
- Skips already installed packages
- Handles dependencies automatically
- Adapts to available package managers
- Custom Installation: Cherry-pick specific packages from each category
- Command-Line Parameters: Support for automated/scripted installation
- Comprehensive Logging and Summary: Track all installation operations
Both scripts store logs in the %USERPROFILE%\Logs
directory:
- Update-System.ps1:
SystemUpdate_[TIMESTAMP].log
- Install-DevTools.ps1:
DevTools_Installation_[TIMESTAMP].log
The log files contain detailed information about:
- Start and end times
- Success or failure of each operation
- Errors encountered during execution
- Summary of all operations
You can modify the script to customize its behavior:
- Change the log directory by modifying the
$logDirectory
variable - Adjust error handling by modifying the
$ErrorActionPreference
variable - Add or remove update mechanisms as needed
See the documentation for more detailed customization options.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Microsoft for winget
- Chocolatey team for Chocolatey
- PSWindowsUpdate module contributors