Created
April 27, 2025 17:41
-
-
Save ronilaukkarinen/fb80026c0ff0efc599cdd353dbe44477 to your computer and use it in GitHub Desktop.
Winget Update Check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save this file to: | |
# C:\Scripts\winget-update-check.ps1 | |
Write-Host "Checking for package updates..." -ForegroundColor Cyan | |
winget upgrade | |
$answer = Read-Host "`nDo you want to update all packages now? (Y/N)" | |
if ($answer -match "^[Yy]$") { | |
winget upgrade --all | |
} else { | |
Write-Host "Skipping updates." -ForegroundColor Yellow | |
} | |
# Open Task Scheduler → Create Task: | |
# General-tab: | |
# Name: Winget Update Check | |
# Location: \ | |
# Author: Leave intact | |
# Description: Can be empty | |
# [x] Run only when user is logged on | |
# | |
# Triggers-tab: | |
# New → At logon (each boot when you log in) | |
# [x] Enabled | |
# | |
# Actions-tab: | |
# New → Start a program | |
# Program/script: C:\Windows\System32\WindowsPowerShell\v1.0\ and there select powershell.exe | |
# Add arguments: -NoExit -ExecutionPolicy Bypass -File "C:\Scripts\winget-update-check.ps1" | |
# -NoExit keeps the window open after it finishes, so you see the output! | |
# Save and you're done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment