jimsdots

My personalized dotfiles and configs for Windows 10 ⚙️


Project maintained by jimbrig Hosted on GitHub Pages — Theme by mattgraham

Scoop

Scoop is a command-line installer for Windows.

Github Repo: lukesampson/scoop


Requirements

Installation

Run the following command from your PowerShell to install scoop to its default location (C:\Users\<user>\scoop)

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

# or shorter
iwr -useb get.scoop.sh | iex

Once installed, run scoop help for instructions. Also run scoop checkup to see if any issues are affecting scoop’s status. Some useful commands to run are:

# install sudo
scoop install sudo

# disable scoop from windows defender realtime scanning
sudo Add-MpPreference -ExclusionPath 'C:\ProgramData\scoop'
sudo Add-MpPreference -ExclusionPath 'C:\Users\jimbr\scoop'

# enable long path support in registry
sSet-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1

image-20210428220135576

The default setup is configured so all user installed programs and Scoop itself live in C:\Users\<user>\scoop. Globally installed programs (--global) live in C:\ProgramData\scoop. These settings can be changed through environment variables.

Setup virustotal scanning with your accounts API key:

scoop config virustotal_api_key <api_key>

Buckets

The following buckets are known to scoop:

The main bucket is installed by default. To add any of the other buckets, type:

scoop bucket add bucketname

For example, to add the extras bucket, type:

scoop bucket add extras

See the scoop directory.

Chocolatey Comparison

How is Scoop different to Chocolatey?

NOTE While it would be easy to install Skype with Scoop, this will probably never be in Scoop’s main bucket (app repository). Scoop focuses on open-source, command-line developer tools. The scoop-extras bucket is for non developer tools.

Commands

Information on Scoop’s commands is built-in. If you use Git you should find the help interface familiar.

To see a list of commands, run:

scoop help

To see help on a specific command, run:

scoop help <command>

The current commands are (output from scoop help):

alias          Manage scoop aliases
bucket         Manage Scoop buckets
cache          Show or clear the download cache
checkup        Check for potential problems
cleanup        Cleanup apps by removing old versions
config         Get or set configuration values
create         Create a custom app manifest
depends        List dependencies for an app
export         Exports (an importable) list of installed apps
help           Show help for a command
hold           Hold an app to disable updates
home           Opens the app homepage
info           Display information about an app
install        Install apps
list           List installed apps
prefix         Returns the path to the specified app
reset          Reset an app to resolve conflicts
search         Search available apps
status         Show status and check for new app versions
unhold         Unhold an app to enable updates
uninstall      Uninstall an app
update         Update apps, or Scoop itself
virustotal     Look for app's hash on virustotal.com
which          Locate a shim/executable (similar to 'which' on Linux)

Example Setup Scripts

Here are some example ‘get-all-my-stuff’ scripts.

It’s assumed that you have Powershell 5 and you’ve already installed Scoop, e.g.

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
set-executionpolicy unrestricted -s cu

Example dev environment setup

# utils
scoop install 7zip curl sudo git openssh coreutils grep sed less

# programming languages
scoop install python ruby go nodejs

# WAMP stack
scoop install apache mariadb php
iex (new-object net.webclient).downloadstring('https://gist.github.com/lukesampson/6546858/raw/apache-php-init.ps1')

# console theme
scoop install concfg pshazz
concfg import solarized small

# vim
scoop install vim
'
set ff=unix

set cindent
set tabstop=4
set shiftwidth=4
set expandtab
set backupdir=$TEMP
' | out-file ~/.vimrc -enc oem -append

Example production environment setup

scoop install sudo 7zip

# make these available to system processes
sudo scoop install git ruby postgres --global

# just for me
scoop install grep coreutils

Powershell Modules

PowerShell modules are installed like other apps, but they are also linked under ~\scoop\modules.

The ~\scoop\modules directory will be added to your $env:PSModulePath environment variable, and PowerShell should automatically detect the modules you install here using Scoop.

The directories under ~\scoop\modules aren’t normal directories. Each is a directory junction which points to the currently installed version of the app/module, which is itself a directory junction pointing to the actual versioned directory. So for a module named MyPSModule you might have something like this:

~\scoop\modules\MyPSModule`
 → *points to* `~\scoop\apps\mypsmodule\current`
  → *points to* `~\scoop\apps\mypsmodule\1.16.0.rc2

The key part of the Scoop manifest for a PowerShell module is this:

{
...
    "psmodule": {
        "name": "NameOfTheModule"
    }
...
}

The name property is required if you use psmodule, and it should match the name of the .psd1 manifest for the PowerShell module for PowerShell to consider it “well-formed” and automatically detect the module (see here for more.)

Shovel

Ash258/Scoop-Core: Shovel. Alternative, more advanced, and user-friendly implementation of windows command-line installer scoop. (github.com)

scoop install sudo
sudo scoop install 7zip git openssh --global
scoop install aria2 curl grep sed less touch
scoop install python ruby go perl

My Installed Packages

I primarily use Chocolatey and winget as my package managers on windows, however, scoop has some amazing benefits and also includes some packages that the aforementioned managers do not.

My Buckets:

Add buckets:

scoop bucket add extras
scoop bucket add scoop-completion https://github.com/Moeologist/scoop-completion
scoop bucket add nonportable
scoop bucket add nerd-fonts
scoop bucket add r-bucket https://github.com/cderv/r-bucket.git
scoop bucket add Sysinternals 'https://github.com/Ash258/Scoop-Sysinternals.git'
scoop bucket add wsl https://git.irs.sh/KNOXDEV/wsl
scoop bucket add rasa https://github.com/rasa/scoops.git
scoop bucket add retools https://github.com/TheCjw/scoop-retools.git
scoop bucket add dorado https://github.com/chawyehsu/dorado

Apps

Here’s what I use scoop to install:

As well as,

WSL

A scoop bucket of installers for Windows Subsystem for Linux.

Make absolutely certain to enable the WSL feature first, like so:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Install scoop like this:

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

Then install this software bucket like this:

scoop bucket add wsl https://git.irs.sh/KNOXDEV/wsl

Now you can quickly and automatically install the software registered here. No Windows Store necessary. For example, to install Ubuntu 20.04 LTS, just use:

scoop install wsl-ubuntu2004

For a full list of current supported distros, check the bucket, or just run:

scoop search wsl-

That’s it! The software in this bucket should not be considered stable and may not install successfully while its a Work In Progress.

notes