Photo - Roseanna Smith
Photo

Windows

Use PowerShell

To get to a PowerShell from a command prompt:

powershell

You can also hit the Windows (⊞) key and type in "PowerShell" to find a PowerShell Prompt.

I prefer to configure my IDEs to also use PowerShell. In Visual Studio Code (VSCode):

// Settings.json
{
    // ...
    "terminal.integrated.shell.windows": "powershell.exe"
}

Use a Package Manager

There are several options such as scoop for Windows.

Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
scoop install sudo
sudo echo "Bloop"

WSL

The so-called Windows Subsystem for Linux.

Reset WSL2 Quickly

If you're getting Network Unreachable in WSL2 for some reason, try this:

sudo Disable-WindowsOptionalFeature -Online -FeatureName -NoRestart `
    $("VirtualMachinePlatform", "Microsoft-Windows-Subsystem-Linux")
sudo Enable-WindowsOptionalFeature -Online -FeatureName `
    $("VirtualMachinePlatform", "Microsoft-Windows-Subsystem-Linux")

Use Docker in WSL2

There are a few ways to get Docker working.

  • A hack such as this one.
  • The Docker Desktop WSL2 integration option.

If you only need Docker to work, I strongly suggest you use the Docker Desktop WSL2 integration.

Systemd in WSL2

You can use a hack such as this one, but really, this isn't a good solution. (Largely because Microsoft updates it a lot and things break often.)

I suggest you investigate a Hyper-V, VMWare, or VirtualBox VM. Alternatively, if you have another disk, dual booting is quite reasonable if you give each OS a disk.

417d50e1050cf201c88e74681074803a86ccd018