This PowerShell script is designed to automate system package upgrades using winget and capture a network configuration snapshot for logging purposes. It provides a clean interface for monitoring progress and saving logs.
Note: This script requires Windows PowerShell 5.1 or higher and that
wingetis installed on your system.
- Automatic Script Relaunch: Ensures the script runs with
-NoExitandBypassexecution policy. - Network Logging: Captures a full
ipconfig /allsnapshot and saves it underNetworkLogswith a timestamped filename. - Winget Auto Upgrade:
- Upgrades all installed packages
- Runs silently with acceptance of package and source agreements
- Includes unknown sources
- Comprehensive Logging: Creates a full transcript log of all operations in the script folder.
- Safe and Organized: All logs are timestamped and stored in structured directories for easy reference.
- Ensure Windows PowerShell 5.1+ is installed.
- Ensure
wingetis installed and accessible from PowerShell. - Place the script in a folder where you want logs to be saved.
- Run the script:
.\WinPatcher.ps1