pwsh
apt update && apt -y install powershell
# 更新包列表
sudo apt-get update
# 安装必备包。
sudo apt-get install -y wget apt-transport-https software-properties-common
# 下载 Microsoft 存储库 GPG 密钥
wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
# 注册 Microsoft 存储库 GPG 密钥
sudo dpkg -i packages-microsoft-prod.deb
# 添加 packages.microsoft.com 后更新包列表
sudo apt-get update
# 安装 PowerShell
sudo apt-get install -y powershell
# 启动 PowerShell
pwsh
下载链接:https://github.com/PowerShell/PowerShell/
yum install powershell-7.2.5-1.rh.x86_64.rpm
下载链接:https://github.com/PowerShell/PowerShell/releases
复制文件powershell-7.2.13-linux-arm64
vi /etc/profile
export PWSH=/root/powershell-7.2.13-linux-arm64
./pwsh
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 (解决启动报错:需要安装libicu)
在 Ubuntu 上安装 PowerShell - PowerShell | Microsoft Docs
PowerShell下载/PowerShell: PowerShell for every system! (github.com)