Installing PowerShell on Kali Linux: Complete Tutorial
Installing PowerShell on Kali Linux: Complete Tutorial
Video Tutorial
Quick Installation
Note: Commands may change over time. For the most up-to-date installation steps, refer to the official Microsoft PowerShell documentation.
Step 1: Prerequisites
Before installing PowerShell, ensure your system is up to date and install the necessary packages:
1
2
3
4
5
# Update the list of packages
sudo apt-get update
# Install pre-requisite packages
sudo apt-get install -y wget
Step 2: Determine Debian Version
To find the Debian version, you can use the following command:
1
2
source /etc/os-release
echo $VERSION_ID
If you are using Kali Linux and the above command does not return a version, you can use Debian 12 as a fallback.
Step 3: Download and Register Microsoft Repository GPG Keys
Download the Microsoft repository GPG keys and register them:
1
2
3
4
5
6
7
8
# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/debian/$VERSION_ID/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
# Delete the Microsoft repository GPG keys file
rm packages-microsoft-prod.deb
Step 4: Update Package List and Install PowerShell
Update the package list and install PowerShell:
1
2
3
4
5
# Update the list of packages after adding packages.microsoft.com
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
Step 5: Start PowerShell
To start PowerShell after installation:
1
pwsh
Updating PowerShell
To update PowerShell when a new version is available:
1
2
sudo apt-get update
sudo apt-get upgrade powershell
This post is licensed under CC BY 4.0 by the author.