Skip to content

Instantly share code, notes, and snippets.

@aruku7230
Last active February 20, 2023 06:37
Show Gist options
  • Save aruku7230/66002f7724b69eef161b6ab75f636705 to your computer and use it in GitHub Desktop.
Save aruku7230/66002f7724b69eef161b6ab75f636705 to your computer and use it in GitHub Desktop.
Manage Pacakges on Windows
#Requires -RunAsAdministrator
# Pin packages.
$packages = @(
'emacs'
'firefox'
'vscode'
'vscode.install'
'microsoft-windows-terminal'
)
foreach ($package in $packages) {
& choco pin add "-n=$package"
}
# Update automatically updated packages (just mark it as latest)
$packages = @(
'firefox'
'vscode'
'vscode.install'
'microsoft-windows-terminal'
)
foreach ($package in $packages) {
Write-Host "Upgrading $package (first upin and pin afterwise)"
& choco pin remove "-n=$package"
& choco upgrade "$package" -n -y
& choco pin add "-n=$package"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment