
上QQ阅读APP看书,第一时间看更新
Using the binary archives
If your package manager does not have PowerShell, use the binary archives:
- Install the dependencies based on your operating system. Here are the dependencies required in the case of Ubuntu 16.04, Ubuntu 18.04, and CentOS:

- Use curl to get the archived file:
$ curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-linux-x64.tar.gz
- Create the directory where PowerShell will be installed:
$ sudo mkdir -p /opt/microsoft/powershell/6.1.0
- Unpack the binaries into the directory you just created:
$ sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.1.0
- Add execute permissions to the file:
$ sudo chmod +x /opt/microsoft/powershell/6.1.0/pwsh
- Create a symbolic link to point to pwsh:
$ sudo ln -s /opt/microsoft/powershell/6.1.0/pwsh /usr/bin/pwsh