PowerShell

PowerShell 使用指南

安装/升级

MacOS

# 安装
brew cask install powershell

# 升级
brew update
brew cask upgrade powershell

Ubuntu 16

通过 .NET Core SDK 安装 PowerShell:

wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

sudo apt-get install -y gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/ubuntu/16.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.0

dotnet tool install --global PowerShell

常用命令

# 确认 PowerShell 版本号
$PSVersionTable

Azure

# 登陆 Azure 中国版账号
Connect-AzAccount -Environment AzureChinaCloud
Author: njun
njun's picture
Updated: 2019/11/24