Skip to content

YoshKoz/updateEverything

Repository files navigation

Windows Update Script (Update-Everything)

A comprehensive, all-in-one PowerShell script that updates everything on your Windows system in a single run — package managers, system components, development tools, and more.

PowerShell Platform License Version

Update-Everything — terminal demo


Quick Install

# One-liner install (downloads to ~/scripts and adds to PATH)
irm https://raw.githubusercontent.com/YoshKoz/windows-update-script/main/install.ps1 | iex

Features

Package Managers

Manager What it does
Winget Upgrades all packages (winget + MS Store sources) with timeout protection, automatic retry of failed packages, and more reliable long-name package detection
Scoop Updates all buckets and packages, cleans up old versions and cache
Chocolatey Upgrades all packages (requires admin)

Windows Components

Component What it does
Windows Update Installs all non-driver updates via PSWindowsUpdate with retry logic for 0x800704c7 errors
Microsoft Store Apps Triggers Store app update scans via MDM/CIM
WSL Updates the WSL kernel and optionally runs apt-get upgrade / pacman -Syu / zypper update inside each distro, preflighting broken distros and skipping non-interactive sudo prompts instead of hanging
Microsoft Defender Updates antivirus signatures

Development Tools

Tool What it does
npm Updates npm itself and all global packages
pnpm Updates global pnpm packages
Bun Self-upgrades Bun
Deno Self-upgrades Deno (detects Scoop/winget-managed installs)
Python / pip Upgrades pip itself and all outdated global pip packages (auto-detects Python install location)
uv Self-updates the uv package manager
uv tools Upgrades all uv-managed tool installs
Rust / rustup Runs rustup update
Cargo binaries Updates global Cargo binaries via cargo-update
Go Updates Go via winget (detects Scoop-managed installs)
.NET tools Updates all global .NET tools, checks NuGet API for latest versions
.NET workloads Runs dotnet workload update
GitHub CLI extensions Runs gh extension upgrade --all
VS Code extensions Runs the VS Code CLI shim (code.cmd / code-insiders.cmd) to update extensions without launching the UI
pipx Upgrades all pipx-managed Python CLI tools
Poetry Self-updates Poetry
Composer Self-updates Composer and global PHP packages
RubyGems Updates RubyGems system and all gems
Oh My Posh Self-upgrades Oh My Posh
yt-dlp Updates yt-dlp (detects pip/scoop/standalone installs)
fnm Detects and reports fnm management method
mise Self-updates mise and upgrades all plugins/tools
juliaup Updates Julia via juliaup
PowerShell modules Updates all installed PSResources (PSResourceGet) and PowerShellGet modules, with parallel support

System Cleanup

Action What it does
Temp files Removes temp files older than 7 days
DNS cache Flushes the DNS client cache
Recycle Bin Empties the Recycle Bin
Crash dumps Clears local crash dump files
WER reports Clears Windows Error Reporting queue
DISM Cleans the WinSxS component store (admin only)
Delivery Optimization Clears the DO cache (admin only)
Prefetch Clears prefetch files (admin only, unless -SkipDestructive)

Requirements

  • PowerShell 7+ (recommended for parallel dev-tool updates and -Parallel support; falls back to Windows PowerShell)
  • Administrator privileges for: Windows Update, Chocolatey, WSL, Defender, Store apps, DISM cleanup
  • PSWindowsUpdate module for Windows Update (Install-Module PSWindowsUpdate -Force)

Installation

# Clone this repo
git clone https://github.com/YoshKoz/windows-update-script.git
cd windows-update-script

# Or just download the script directly
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/YoshKoz/windows-update-script/main/updatescript.ps1" -OutFile updatescript.ps1

Usage

Basic (run in current terminal)

.\updatescript.ps1

Run elevated (opens a new UAC-prompt window)

.\updatescript.ps1 -AutoElevate

Quick run (skip slow operations)

.\updatescript.ps1 -FastMode

Skip specific components

.\updatescript.ps1 -SkipWindowsUpdate -SkipWSL -SkipCleanup

Schedule daily automatic updates

.\updatescript.ps1 -Schedule -ScheduleTime "03:00"

Log output to file

.\updatescript.ps1 -LogPath "C:\Logs\update.log"

Parameters

Parameter Type Default Description
-SkipWindowsUpdate Switch $false Skip Windows Update
-SkipReboot Switch $false Suppress automatic reboot after updates
-SkipDestructive Switch $false Skip destructive cleanup tasks (Go mod cache, prefetch)
-FastMode Switch $false Skip slow operations (RubyGems, Volta, fnm, mise, etc.)
-NoElevate Switch $false Prevent auto-elevation even with -AutoElevate
-AutoElevate Switch $false Relaunch the script as Administrator (opens new window)
-NoPause Switch $false Skip the "Press Enter to close" prompt (for CI / VS Code)
-Parallel Switch $false Enable parallel updates where supported (PS7+)
-SkipWSL Switch $false Skip WSL kernel update
-SkipWSLDistros Switch $false Skip updating packages inside WSL distros
-SkipDefender Switch $false Skip Defender signature update
-SkipStoreApps Switch $false Skip Microsoft Store app scan
-SkipUVTools Switch $false Skip uv tool upgrades
-SkipVSCodeExtensions Switch $false Skip VS Code extension updates
-SkipPoetry Switch $false Skip Poetry self-update
-SkipComposer Switch $false Skip Composer updates
-SkipRuby Switch $false Skip RubyGems updates
-SkipPowerShellModules Switch $false Skip PowerShell module updates
-SkipCleanup Switch $false Skip the system cleanup section
-WingetTimeoutSec Int 300 Per-call timeout for winget in seconds
-Schedule Switch $false Register a daily scheduled task
-ScheduleTime String "03:00" Time for the scheduled task
-LogPath String Path to write a transcript log file
-SkipNode Switch $false Skip Node.js ecosystem updates (npm, pnpm, bun, deno, fnm, volta)
-SkipRust Switch $false Skip Rust toolchain updates
-SkipGo Switch $false Skip Go toolchain updates
-SkipFlutter Switch $false Skip Flutter SDK updates
-SkipGitLFS Switch $false Skip Git LFS updates
-DeepClean Switch $false Run DISM, Delivery Optimization cleanup, and prefetch cleanup
-UpdateOllamaModels Switch $false Opt in to updating every installed Ollama model
-WhatChanged Switch $false Show winget package version changes since the previous run
-NoParallel Switch $false Disable parallel execution for independent dev-tool updates
-DryRun Switch $false Print which sections would run without executing them

How It Works

Execution flow diagram

  1. Self-elevation — If -AutoElevate is passed and the script isn't running as admin, it relaunches itself elevated via UAC, forwarding all parameters.
  2. Smart detection — Each update section checks whether its tool is installed (Test-Command) before attempting updates. Missing tools are silently skipped.
  3. Managed-install detection — For tools like Deno, Go, uv, Oh My Posh, etc., the script detects whether they're managed by Scoop or winget and skips redundant self-updates.
  4. Winget timeout protection — Winget calls use Start-Process with file-based I/O redirection and a configurable timeout to prevent hanging on stuck installers.
  5. Automatic retry — Failed winget packages are detected by parsing output and retried individually with --force.
  6. Windows Update resilience — Uses -IgnoreReboot to prevent 0x800704c7 (ERROR_CANCELLED), with automatic service restart and retry.
  7. Clean output — ANSI escape sequences, progress bars, and spinner frames are stripped from tool output for clean terminal display.
  8. Accurate failure reporting — Per-distro WSL failures and timeouts now bubble up to the main summary instead of being shown as success.
  9. Summary report — At the end, a color-coded summary shows updated, checked, failed, and skipped components with total elapsed time and per-section timings.

Example Output

Completion Summary

Update summary report

======================================================
  Update-Everything v2.6.3  |  2026-03-23 16:30
  Running as Administrator
======================================================

======================================================
 Scoop
======================================================
[OK] Scoop updated (12.3s)

======================================================
 Winget
======================================================
  Upgrading all (winget source, timeout: 300s)...
  Successfully installed Package.Name v1.2.3
[OK] Winget updated (45.2s)

...

======================================================
 UPDATE COMPLETE -- 00:03:42
======================================================

[OK] Succeeded (15): Scoop, Winget, Chocolatey, WindowsUpdate, ...
[!] Skipped   (3): WSL, Poetry, Composer

Scheduling

To run the script automatically every day at 3 AM:

.\updatescript.ps1 -Schedule -ScheduleTime "03:00"

This creates a Windows Scheduled Task named DailySystemUpdate that runs elevated with -SkipReboot.


Troubleshooting

Issue Solution
0x800704c7 during Windows Update Already handled with retry logic; ensure no pending reboots
Winget hangs indefinitely Increase -WingetTimeoutSec or check for stuck installers in Task Manager
PSWindowsUpdate module not found Run Install-Module PSWindowsUpdate -Force
Admin-only tasks skipped Run with -AutoElevate or start terminal as Administrator
Scoop/winget not found Install them first: scoop.sh, winget

License

MIT License — free to use, modify, and distribute. See LICENSE.


Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.


Changelog

See CHANGELOG.md for version history.

About

All-in-one PowerShell script that updates 30+ tools, package managers, and Windows components in a single run

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors