Powershell Install
# Install dependencies sudo apt update sudo apt install -y wget apt-transport-https software-properties-common # Import Microsoft GPG key wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb # Install PowerShell sudo apt update sudo apt install -y powershell
Launch PowerShell:
pwsh
* * *
### CentOS / RHEL / Fedora
# Add Microsoft YUM repository sudo dnf install -y https://packages.microsoft.com/config/rhel/8/packages-microsoft-prod.rpm# Install PowerShell sudo dnf install -y powershell
Or use `yum` for CentOS 7:
sudo yum install -y powershell
* * *
### Arch Linux / Manjaro
sudo pacman -S powershell
> If not found, use AUR package manager (e.g., `yay`)
* * *
## 3. Installing PowerShell on macOS
### Method 1: Using Homebrew (Recommended)
brew install --cask powershell
Launch PowerShell:
pwsh
### Method 2: Manual PKG Download
1. Go to GitHub release page
π [https://github.com/PowerShell/PowerShell/releases](https://github.com/PowerShell/PowerShell/releases)
2. Download `.pkg` installer file (e.g., `powershell-7.4.1-osx-x64.pkg`)
3. Double-click to install and follow the prompts
* * *
## 4. Installation Verification and Uninstallation
### Verify Installation
pwsh --version
### Uninstall PowerShell
| Platform | Uninstall Method |
| --- | --- |
| Windows | Control Panel β Programs and Features β Uninstall PowerShell 7 |
| Ubuntu | `sudo apt remove powershell` |
| CentOS | `sudo yum remove powershell` |
| macOS (brew) | `brew uninstall powershell` |
* * *
## Launch Commands by Platform
| Platform | Command |
| --- | --- |
| Windows | `pwsh.exe` or search "PowerShell 7" in Start menu |
| Linux | `pwsh` |
| macOS | `pwsh` |
YouTip