Ga naar inhoud

PowerShell Cheat-SheetΒΆ

PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language.

Install PowerShellΒΆ

PowerShell was made open-source and cross-platform with PowerShell Core, and can be installed on multiple operating systems.

WindowsΒΆ

  1. Download MSI Package from the Official PowerShell Docs
  2. Set up PowerShell Profile in Windows Terminal.
    1
    2
    3
    "commandline": "pwsh.exe -nologo",
    "name": "Powershell",
    "source": "Windows.Terminal.PowershellCore"
    

Linux (Ubuntu)ΒΆ

# Update the list of packages
sudo apt-get update
# Install pre-requisite packages.
sudo apt-get install -y wget apt-transport-https software-properties-common
# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
# Update the list of packages after we added packages.microsoft.com
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
pwsh

ProfileΒΆ

Set up a PowerShell Profile by opening the profile script :

code $PROFILE

(Optional) Set up starship PromptΒΆ

You can customize the look and feel of PowerShell with the Starship Prompt ([[starship]]).