Skip to content

About

Interactive PowerShell wrapper for WinGet (winget upgrade --include-unknown) featuring persistent package exclusions, selective updates, and natural license prompts under the 'wgu' alias.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

WinGetUpdate

A lightweight PowerShell module that wraps winget upgrade --include-unknown with interactive package exclusion management, license agreement passthrough, selective updates, and concise status summaries under the primary alias wgu.

WinGetUpdate Preview


Features

  • Primary Alias (wgu): Quickly run update checks with a single short command.
  • --include-unknown Support: Detects upgrades for packages whose currently installed version string is unknown/untracked by WinGet.
  • Interactive Exclusion Management: Easily exclude software (e.g. pinned versions) by Package ID or wildcard pattern.
  • Interactive Menu: Choose to upgrade all packages, select specific item numbers, edit exclusions, or exit (pressing Enter defaults to Cancel).
  • License Agreement Passthrough: License terms and source agreements output directly to your console, allowing standard interactive approval.
  • Persistent Storage: Exclusions automatically persist in %LOCALAPPDATA%\WinGetUpdate\exclusions.json.

⚠️ Security Disclaimer & PowerShell Script Unblocking

Warning

Important Security Notice: The PowerShell scripts in this repository are unsigned. Executing downloaded scripts from the internet can be dangerous. You should always review and audit the source code before blindly proceeding or importing unsigned modules into your environment.

Resolving Blocked Scripts & Execution Policy Issues

When downloading files from GitHub, Windows often attaches a "Zone.Identifier" (Mark-of-the-Web) attribute, which causes PowerShell to block execution. Additionally, restricted PowerShell ExecutionPolicy settings may prevent unsigned scripts from loading.

1. Unblocking Module Files

After extracting or downloading the repository, unblock the files by running:

# Unblock all module files recursively
Get-ChildItem -Path "$HOME\Documents\PowerShell\Modules\WinGetUpdate" -Recurse | Unblock-File

(Alternatively: Right-click the .psd1 / .psm1 files in File Explorer → select Properties → check Unblock → click Apply.)

2. Allowing RemoteSigned Execution (if necessary)

If PowerShell prevents running scripts altogether, set your execution policy to allow RemoteSigned scripts for the current user:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Installation Guide

Option 1: User Modules Folder (Recommended - Available Everywhere)

Clone the repository or download and extract the release .zip into your user PowerShell modules directory:

Windows PowerShell / PowerShell 7:

# Create module folder if it doesn't exist
New-Item -ItemType Directory -Path "$HOME\Documents\PowerShell\Modules\WinGetUpdate" -Force

# Option A: Clone repository into the Modules directory
git clone https://github.com/hoakerk/WinGetUpdate.git "$HOME\Documents\PowerShell\Modules\WinGetUpdate"

# Option B: Or download source ZIP, extract, and copy contents into:
# $HOME\Documents\PowerShell\Modules\WinGetUpdate\

Once placed in $HOME\Documents\PowerShell\Modules\, PowerShell auto-loads the module so wgu is available in every session.


Option 2: Load via PowerShell Profile

If you prefer keeping the repo in a custom folder, import it in your profile:

  1. Open your profile in a text editor:
    notepad $PROFILE
  2. Add the import command (adjust path to where you cloned the repo):
    Import-Module "C:\Path\To\WinGetUpdate\WinGetUpdate.psd1"
  3. Reload your profile:
    . $PROFILE

Option 3: Quick One-Time Session Import

Import-Module ".\WinGetUpdate.psd1" -Force

How-To & Usage

1. Launch Interactive Upgrade Menu (wgu)

wgu

Menu Options:

  • [Y] Proceed: Upgrades all available non-excluded packages using winget upgrade --id <Id> --include-unknown.
  • [S] Select: Lets you enter comma-separated numbers (e.g., 1,3,5) to upgrade only specific packages.
  • [E] Exclusions: Opens the exclusion sub-menu.
  • [N] Cancel (Default): Exits the menu. Pressing Enter defaults to Cancel.

2. Running List-Only Check

View available and excluded updates without triggering the interactive prompt:

Invoke-WinGetUpdate -ListOnly

3. Managing Exclusions

Exclusions prevent specific packages from being upgraded automatically.

Add an Exclusion

# By exact Package ID
wgu-add "Microsoft.Edge"

# Or using wildcards
wgu-add "*Chrome*"

# Standard Cmdlet syntax
Add-WinGetExclusion -Pattern "Google.Chrome"

View Current Exclusions

wgu-list
# or
Get-WinGetExclusion

Remove an Exclusion

wgu-remove "Microsoft.Edge"
# or
Remove-WinGetExclusion -Pattern "Microsoft.Edge"

Configuration & Storage Path

Exclusions are saved as JSON at: %LOCALAPPDATA%\WinGetUpdate\exclusions.json


Available Cmdlets & Aliases

Cmdlet Alias Description
Invoke-WinGetUpdate wgu Runs update check and opens interactive menu
Get-WinGetExclusion wgu-list Lists all active exclusion patterns
Add-WinGetExclusion wgu-add Adds a package ID or pattern to exclusions
Remove-WinGetExclusion wgu-remove Removes a package ID or pattern from exclusions

Acknowledgments

This project was built and refactored with the assistance of the following AI models via Antigravity:

  • Claude 3.7 Sonnet / Claude 4.6 (Thinking) – Architecture design, initial implementation, refactoring, and code simplification.
  • Gemini 3.6 Flash – Fine-tuning, formatting, documentation updates, and repository preparation.

License

MIT License. Feel free to contribute or adapt for your needs!

About

Interactive PowerShell wrapper for WinGet (winget upgrade --include-unknown) featuring persistent package exclusions, selective updates, and natural license prompts under the 'wgu' alias.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages