Skip to content

Instantly share code, notes, and snippets.

@pl0xyelit
Last active November 2, 2022 20:31
Show Gist options
  • Save pl0xyelit/5417a15da5ead55b8506170c305f2500 to your computer and use it in GitHub Desktop.
Save pl0xyelit/5417a15da5ead55b8506170c305f2500 to your computer and use it in GitHub Desktop.
wg - a PowerShell function wrapper for winget
$packageFile = Get-Content -Path "D:\PowerShell\packages.txt"
function wg {
param
(
[ValidateSet("upgrade","install", "uninstall")]
$type,
$packages = $packageFile
)
$packages | ForEach-Object { winget $type $_ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment