Applications/windows/powershell.md
2024-04-03 22:04:13 +02:00

1.5 KiB

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.
"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).