Skip to content

Sterbweise/winget-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Winget Update Manager

PowerShell Windows License Version GitHub Stars GitHub Issues Repo Size

image

Summary

Winget Update Manager is a comprehensive PowerShell automation tool designed for Windows system administrators and power users. It provides intelligent application lifecycle management using Windows Package Manager (winget) with advanced features including smart application detection, persistent exclusion management, and comprehensive logging capabilities.

🎯
Smart Detection
Intelligent app matching

Multiple Modes
8 execution modes
🛡️
Usage Ready
Advanced logging
🔧
Easy Setup
One-line installation

Quick Installation

One-Line Installation

iex ((New-Object System.Net.WebClient).DownloadString('https://raw.github.com/sterbweise/winget-update/main/install.ps1'))

After installation, use winget-update from anywhere in PowerShell

Table of Contents


🔧 Installation

📦 One-Line Installation (Recommended)
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.github.com/sterbweise/winget-update/main/install.ps1'))

What this does:

  • ✅ Downloads and installs the latest version
  • ✅ Creates a global winget-update command
  • ✅ Sets up the necessary directory structure
  • ✅ Configures PowerShell profile integration
📥 Manual Installation
# Download the script
Invoke-WebRequest -Uri "https://raw.github.com/sterbweise/winget-update/main/winget-update.ps1" -OutFile "winget-update.ps1"

# Set execution policy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

# Run the script
.\winget-update.ps1
🔄 Git Installation
git clone https://github.com/sterbweise/winget-update.git
cd winget-update
.\winget-update.ps1 -Help

⚙️ System Requirements

Component Requirement Status
🖥️ OS Windows 10 (1809+) / Windows 11 Required
⚡ PowerShell 5.1 / 7.0+ Required
📦 Winget 1.0+ Required
🔐 Privileges Administrator Auto
💾 Memory 512 MB RAM Minimal
💿 Storage 100 MB Minimal

🎮 Quick Start

Basic Usage

🔄 Standard Update

winget-update

Interactive mode with modern interface and real-time progress

👀 Preview Mode

winget-update -Mode dry-run

See what would be updated without making changes

🤫 Silent Mode

winget-update -Mode silent

Automated execution for scripts and scheduled tasks

🚀 Full Upgrade

winget-update -Mode full-upgrade

Updates all packages including unknown versions

📚 Usage

Execution Modes

Mode Description Use Case Icon
normal Interactive with prompts Desktop environments 🖥️
silent Automated execution Scheduled tasks 🤫
dry-run Simulation mode Testing & planning 👀
force Bypass restrictions Emergency updates
verbose Detailed logging Debugging 📝
no-interaction Zero user input Server environments 🤖
full-upgrade Include all packages Complete refresh 🚀
safe-upgrade Conservative approach Production systems 🛡️

🎯 Smart Exclusion Management

Temporary Exclusions
# Exclude apps from current session only
winget-update -ExcludeApps "Microsoft.Edge,Discord.Discord"
  • ✅ Supports both friendly names and exact IDs
  • ✅ Use comma separation for multiple applications
  • ✅ Only affects current update session
Permanent Exclusions
# Smart addition to permanent exclusion
winget-update -AddPersistentExcludeApps "Chrome"

# Smart removal from permanent exclusion
winget-update -RemovePersistentExcludeApps "Discord"
  • 🧠 Intelligent name matching
  • 🔍 Shows suggestions for ambiguous matches
  • 💾 Automatically saves to persistent_exclude_apps.txt

⚙️ Advanced Parameters

Custom Parameters
# Pass custom parameters to winget
winget-update -CustomParams "--include-unknown --force"

# Production automation example
winget-update -Mode silent -ExcludeApps "Microsoft.VisualStudio.2022.Community" -CustomParams "--accept-source-agreements"

# Maximum logging for debugging
winget-update -Mode verbose -CustomParams "--include-unknown --verbose-logs"

🔧 Configuration

📁 File Structure

📦 winget-update/
├── 📜 winget-update.ps1              # Main executable script
├── 📜 install.ps1                    # Installation script
├── 📋 persistent_exclude_apps.txt    # Permanent exclusion list
├── 📁 logs/                          # Log file directory
│   └── 📄 winget_update_*.log         # Timestamped execution logs
└── 📖 README.md                      # This documentation

⚙️ Smart Application Categories

Category Priority Examples
Development 🔴 High Visual Studio, Git, Docker
Security 🔴 High Antivirus, VPN, Firewall
Browser 🟡 Medium Chrome, Firefox, Edge
Productivity 🟡 Medium Office, Teams, Notion
Media 🟢 Low VLC, Spotify, OBS
Gaming 🟢 Low Steam, Discord, Epic

🚀 Advanced Features

Intelligent Detection

🔍 Smart Name Matching

# Input: "Visual Studio Code"
# Output: Microsoft.VisualStudioCode

🎯 Fuzzy Search

# Input: "Chrome"
# Output: Multiple matches with selection

📊 Automatic Categorization

  • High Priority: Dev tools, security
  • Medium Priority: Browsers, productivity
  • Low Priority: Entertainment, gaming

⚡ Performance Optimization

  • Concurrent update processing
  • Intelligent retry mechanisms
  • Resource usage monitoring

🤖 Automation Integration

Windows Task Scheduler
$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-Command winget-update -Mode silent"
$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Sunday -At "2:00 AM"
Register-ScheduledTask -TaskName "WingetUpdateManager" -Action $action -Trigger $trigger -RunLevel Highest
PowerShell Profile
# Add to $PROFILE for custom aliases
function Update-Apps { winget-update -Mode silent }
function Preview-Updates { winget-update -Mode dry-run }
function Update-Verbose { winget-update -Mode verbose }

🛠️ Troubleshooting

Common Issues Quick Fix

❌ winget Command Not Found

Symptoms: 'winget' is not recognized as an internal or external command

Solutions:

# Method 1: Install from Microsoft Store
# Search for "App Installer" and install

# Method 2: Manual installation
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe

# Method 3: Download from GitHub
# Visit: https://github.com/microsoft/winget-cli/releases
🔒 Script Execution Policy Errors

Symptoms: Execution of scripts is disabled on this system

Solutions:

# Recommended: Set policy for current user
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

# Alternative: Bypass for single execution
powershell.exe -ExecutionPolicy Bypass -File ".\winget-update.ps1"
🛡️ Access Denied During Updates

Symptoms: Permission errors, "Access is denied" messages

Solutions:

# Check admin status
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
Write-Host "Running as Admin: $isAdmin"

# Run as Administrator
Start-Process powershell -Verb RunAs -ArgumentList "-File `"$PWD\winget-update.ps1`""
🔍 Smart Detection Issues

Symptoms: Applications not found, "No matches found" errors

Solutions:

# List all installed applications
winget list | Out-GridView

# Search with partial name
winget search "Visual Studio"

# Use exact ID
winget-update -AddPersistentExcludeApps "Microsoft.VisualStudioCode"

🔧 Advanced Debugging

System Information Collection
$info = @{
    "PowerShell Version" = $PSVersionTable.PSVersion
    "Windows Version" = (Get-CimInstance Win32_OperatingSystem).Caption
    "Winget Version" = (winget --version)
    "Execution Policy" = (Get-ExecutionPolicy)
    "Is Admin" = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
}
$info | Format-Table -AutoSize

🤝 Contributing

We Welcome Contributions!

🍴
Fork
Fork the repository
🌿
Branch
Create feature branch

Develop
Add your changes
🧪
Test
Test thoroughly
📤
Submit
Create pull request

🛠️ Development Setup

# Clone repository
git clone https://github.com/sterbweise/winget-update.git
cd winget-update

# Install development tools
Install-Module -Name Pester -Force
Install-Module -Name PSScriptAnalyzer -Force

# Run code analysis
Invoke-ScriptAnalyzer -Path ".\winget-update.ps1"

📄 License

This project is licensed under the MIT License - see the LICENSE file for full details.

Summary: You are free to use, modify, distribute, and sell this software. No warranty is provided.


🌟 Support the Project

If you find this project helpful, please consider:

⭐ Star 🐛 Report Bug 💡 Request Feature


❤️ Developed by Sterbweise

Making Windows package management intelligent and effortless

GitHub Profile