Last active
February 20, 2023 06:37
-
-
Save aruku7230/66002f7724b69eef161b6ab75f636705 to your computer and use it in GitHub Desktop.
Manage Pacakges on Windows
This file contains 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
#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