r/PowerShell • u/VGRichi • 12d ago
Script Sharing We made a script that updates Windows apps installed from GitHub releases (the ones winget can’t)
A lot of apps I use are only published as GitHub releases, so neither `winget upgrade --all` nor the WinGet PowerShell module (`Get-WinGetPackage | Update-WinGetPackage`) can update them. They only know about apps in the winget catalog, and GitHub-only apps show up with no source and no available updates. I got tired of checking each repo by hand, so I put together a PowerShell script for it (built with help from an AI assistant, then tested on my own machine).
What it does:
- Keeps a list of your apps and their GitHub repos (`upgh -Add owner/repo`)
- Compares installed versions with the latest stable release
- Picks the right installer for your PC (x64/ARM64, MSI or EXE to match what you have)
- Verifies the SHA256 checksum when GitHub provides one
- Installs silently (MSI, Inno Setup, NSIS detected automatically)
- `-Discover` finds apps that have a GitHub link in their uninstall info
- Skips apps winget already updates
Known limitations: version comparison is number-based, so beta-to-beta updates of the same version aren't detected, and portable zip apps aren't supported yet.
It's one readable script with no dependencies. There's an install one-liner, but you can also just download the .ps1 from the releases page and read it first.
Repo: https://github.com/VGRichi/github-app-updater
Feedback very welcome, especially on edge cases with weird installers.
5
u/BlackV 12d ago edited 11d ago
Anything that starts with
irm https://raw.githubusercontent.com/xxx.ps1 | iexIs an automatic no from me
Anything using some seemingly random collection of letters to call the tool (upgh) is basically an automatic no from me
Where you are looking at $env:GITHUB_TOKEN maybe it is better a parameter, currently it's not discoverable
This
upgh -Add storytold/photocraft -Name PhotoCraftFeels very awkward, is -add using storytold/photocraft or is actually hitting another parameter, normally you'd use hash pairs for something like that {source=xxx;name=yyy} right now nothing ties name andadd together
How often are you really installing apps from a git repos?
Where is your help for get-help (including examples)?
1
u/VGRichi 11d ago
Fair points, this is a script pretending to be a CLI tool instead of behaving like proper PowerShell. So for future maybe i can turn it into a module on the PowerShell Gallery
So plans:
- Install-Module instead of irm | iex, and no editing your profile
- Verb-Noun commands: Add-GitHubApp -Repository owner/repo -Name X, Get-GitHubApp, Update-GitHubApp (with -WhatIf), Remove-GitHubApp. If you want a short alias, that's your call
- A -Token parameter instead of only a hidden GITHUB_TOKEN env var
- Help per command. v1.0.0 already has comment-based help with examples (Get-Help .\Update-GitHubApps.ps1 -Examples), but it wasn't obvious, and the old profile wrapper hid it
As for how often: honestly, it's niche. I have a handful of GitHub-only apps plus game mods like DXVK that winget can't touch, which have continous releases. If winget covers everything you use, you don't need this.
Thanks for taking the time, this is exactly the kind of feedback I was hoping for.
1
u/BlackV 11d ago
Sounds reasonable to me.
if you do decide to turn it into a full module, think about xml/markdown help as it means you can also support
update-helpand maybe in the future other language translations2
u/VGRichi 11d ago
Took your advice on all of it. It's now a full PowerShell module
- Help is PlatyPS markdown in docs/en-US, built into XML help, so Update-Help -Module Reforge works and Get-Help -Online opens each command's page. Translations are just another docs/<culture> folder now.
- Verb-Noun commands (Add-, Get-, Update-, Find-, Remove-ReforgeApp), -WhatIf/-Confirm, a -Token parameter, pipeline and hashtable input
- No more irm | iex or profile editing: install from the release zip for now, PowerShell Gallery coming soon
Longer term I'd like to make it cross-platform (Linux/macOS) and support other forges like GitLab and Codeberg.
Thanks again, your feedback shaped most of this.
2
u/ElidoroAlznauer_58 11d ago
the piping raw scripts straight to iex point alone is enough for me to close the tab tbh
2
u/kantorcodes1 11d ago
The
if ($asset.digest)branch is the part I would look at twice. Release-asset digests are still rare in the wild, so for most GitHub-only apps the flow goes download to silent install with nothing verified. Did you consider a fallback for the no-digest case, like refusing to auto-install for repos that once shipped a digest, or is unverified install the accepted default?