Published on 12 May 2022 by Andrew Owen (3 minutes)
If you have even a passing familiarity with Linux, you’re probably aware of the concept of package management. The goal is to simplify the installing, upgrading, configuring and removing software. One of the key features is dependency management: if your software depends on some other software that isn’t already installed, the package manager will give you the option to install it.
Microsoft provides a Windows Package Manager, known as winget. However, at the time of writing it’s only been around for a couple of years and I got a hash error when I tried to use it to install Google Chrome.
A popular third-party option is Chocolatey, but it depends on NuGet which is a package manager in its own right. I prefer to use Scoop. The latest install instructions are on the website, but I’ll go through how I installed it on Windows 11.
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
. This enables a remote script to run the first time.Invoke-WebRequest get.scoop.sh | Invoke-Expression
. This installs Scoop.scoop bucket add extras
. The extras bucket includes software that doesn’t match the main criteria for inclusion.scoop bucket add nonportable
. The nonportable bucket includes software that must be installed to a specific location.scoop install git
. Even if you’re not using Git, Scoop uses it to perform updates.scoop update
. This will update the buckets you added.Now you’re ready to add whatever packages you like. Here are some examples:
scoop install docker
scoop install github
scoop install googlechrome
scoop install helm
scoop install notepadplusplus
scoop install sql-server-management-studio-np
scoop install vscode
You can verify the software has been correctly installed by viewing the C:\Users\
<user>
\scoop\apps
folder.
To update all your installed packages to the latest version, enter scoop update all
. When I was creating a VM for developer training with numerous prerequisite software packages, I found it useful to put this command in a startup script.
Having recently revisited the VM setup for Azure Labs, I’ve discovered a few gotchas. Here’s how I got it working.
runas /trustlevel:0x20000 powershell.exe
. The Scoop install script won’t run with admin privileges. The ExecutionPolicy
directive doesn’t work when the shell is run as administrator. And the VM template doesn’t give you the option to start a shell without admin privileges.iwr get.scoop.sh -useb | iex
. The -useb
directive is required with Windows N (something to do with Internet Explorer).scoop bucket add main
.scoop update
.You can now carry on as normal. You don’t need to install Git, because it’s included with the VS 2019 Community image.
Image: Original by Ian Dooley.