2017-03-21 23:20:11 +01:00
# Package installation instructions
2016-03-31 08:29:16 +02:00
2017-10-06 00:46:07 +02:00
Supports [Ubuntu 14.04][u14], [Ubuntu 16.04][u16], [Ubuntu 17.04][u17], [Debian 8][deb8], [Debian 9][deb9],
[CentOS 7][cos], [Red Hat Enterprise Linux (RHEL) 7][rhel7], [OpenSUSE 42.2][opensuse], [Fedora 25][fed25],
2017-10-24 20:13:17 +02:00
[Fedora 26][fed26], [Arch Linux][arch], and [macOS 10.12][mac].
2016-09-20 23:10:40 +02:00
2017-10-24 20:13:17 +02:00
For Linux distributions that are not officially supported,
you can try using the [PowerShell AppImage][lai].
You can also try deploying PowerShell binaries directly using the Linux [`tar.gz` archive][tar],
but you would need to set up the necessary dependencies based on the OS in separate steps.
2016-09-20 23:10:40 +02:00
2017-10-24 20:13:17 +02:00
All packages are available on our GitHub [releases][] page.
Once the package is installed, run `pwsh` from a terminal.
2016-03-31 08:29:16 +02:00
2016-08-12 01:50:50 +02:00
[u14]: #ubuntu -1404
[u16]: #ubuntu -1604
2017-10-06 00:46:07 +02:00
[u17]: #ubuntu -1704
2017-05-09 22:18:01 +02:00
[deb8]: #debian -8
2017-10-06 00:46:07 +02:00
[deb9]: #debian -9
2016-08-12 01:50:50 +02:00
[cos]: #centos -7
2017-05-09 22:18:01 +02:00
[rhel7]: #red -hat-enterprise-linux-rhel-7
2017-10-06 00:46:07 +02:00
[opensuse]: #opensuse -422
[fed25]: #fedora -25
[fed26]: #fedora -26
2017-03-02 02:38:24 +01:00
[arch]: #arch -linux
2016-08-23 02:37:43 +02:00
[lai]: #linux -appimage
2017-05-10 18:49:02 +02:00
[mac]: #macos -1012
2017-10-24 20:13:17 +02:00
[tar]: #binary -archives
2016-08-01 22:46:48 +02:00
2017-03-21 23:20:11 +01:00
## Ubuntu 14.04
2016-03-31 08:29:16 +02:00
2017-03-28 01:44:28 +02:00
### Installation via Package Repository - Ubuntu 14.04
2017-03-18 03:34:25 +01:00
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates).
This is the preferred method.
```sh
# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Ubuntu repository
curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
2017-10-06 00:46:07 +02:00
# Update the list of products
2017-03-18 03:34:25 +01:00
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
2017-10-24 20:13:17 +02:00
pwsh
2017-03-18 03:34:25 +01:00
```
After registering the Microsoft repository once as superuser,
from then on, you just need to use `sudo apt-get upgrade powershell` to update it.
2017-10-06 00:46:07 +02:00
### Installation via Direct Download - Ubuntu 14.04
2017-03-18 03:34:25 +01:00
2017-10-06 00:46:07 +02:00
Download the Debian package
2017-10-25 01:28:22 +02:00
`powershell_6.0.0-beta.9-1.ubuntu.14.04_amd64.deb`
2016-08-12 01:50:50 +02:00
from the [releases][] page onto the Ubuntu machine.
2016-07-27 21:55:10 +02:00
Then execute the following in the terminal:
2016-03-31 08:29:16 +02:00
```sh
2017-10-25 01:28:22 +02:00
sudo dpkg -i powershell_6.0.0-beta.9-1.ubuntu.14.04_amd64.deb
2016-09-20 01:34:23 +02:00
sudo apt-get install -f
2016-03-31 08:29:16 +02:00
```
2016-09-13 06:12:00 +02:00
2016-09-20 01:34:23 +02:00
> Please note that `dpkg -i` will fail with unmet dependencies;
> the next command, `apt-get install -f` resolves these
> and then finishes configuring the PowerShell package.
2016-09-13 06:12:00 +02:00
2017-03-21 23:20:11 +01:00
### Uninstallation - Ubuntu 14.04
2016-09-13 06:12:00 +02:00
2016-09-20 01:34:23 +02:00
```sh
sudo apt-get remove powershell
```
2016-03-31 08:29:16 +02:00
2017-03-21 23:20:11 +01:00
## Ubuntu 16.04
2016-08-12 01:50:50 +02:00
2017-03-28 01:44:28 +02:00
### Installation via Package Repository - Ubuntu 16.04
2017-03-18 03:34:25 +01:00
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates).
This is the preferred method.
```sh
# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Ubuntu repository
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
2017-10-06 00:46:07 +02:00
# Update the list of products
2017-03-18 03:34:25 +01:00
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
2017-10-24 20:13:17 +02:00
pwsh
2017-03-18 03:34:25 +01:00
```
After registering the Microsoft repository once as superuser,
from then on, you just need to use `sudo apt-get upgrade powershell` to update it.
2017-03-28 01:44:28 +02:00
### Installation via Direct Download - Ubuntu 16.04
2017-03-18 03:34:25 +01:00
2017-10-06 00:46:07 +02:00
Download the Debian package
2017-10-25 01:28:22 +02:00
`powershell_6.0.0-beta.9-1.ubuntu.16.04_amd64.deb`
2016-08-12 01:50:50 +02:00
from the [releases][] page onto the Ubuntu machine.
Then execute the following in the terminal:
```sh
2017-10-25 01:28:22 +02:00
sudo dpkg -i powershell_6.0.0-beta.9-1.ubuntu.16.04_amd64.deb
2016-09-20 01:34:23 +02:00
sudo apt-get install -f
2016-08-12 01:50:50 +02:00
```
2016-09-13 06:12:00 +02:00
2016-09-20 01:34:23 +02:00
> Please note that `dpkg -i` will fail with unmet dependencies;
> the next command, `apt-get install -f` resolves these
> and then finishes configuring the PowerShell package.
2016-09-13 06:12:00 +02:00
2017-03-21 23:20:11 +01:00
### Uninstallation - Ubuntu 16.04
2016-09-13 06:12:00 +02:00
2016-09-20 01:34:23 +02:00
```sh
sudo apt-get remove powershell
```
2016-08-12 01:50:50 +02:00
2017-10-06 00:46:07 +02:00
## Ubuntu 17.04
### Installation via Package Repository - Ubuntu 17.04
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates).
This is the preferred method.
```sh
# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Ubuntu repository
curl https://packages.microsoft.com/config/ubuntu/17.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
# Update the list of products
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
2017-10-24 20:13:17 +02:00
pwsh
2017-10-06 00:46:07 +02:00
```
After registering the Microsoft repository once as superuser,
from then on, you just need to use `sudo apt-get upgrade powershell` to update it.
### Installation via Direct Download - Ubuntu 17.04
Download the Debian package
2017-10-25 01:28:22 +02:00
`powershell_6.0.0-beta.9-1.ubuntu.17.04_amd64.deb`
2017-10-06 00:46:07 +02:00
from the [releases][] page onto the Ubuntu machine.
Then execute the following in the terminal:
```sh
2017-10-25 01:28:22 +02:00
sudo dpkg -i powershell_6.0.0-beta.9-1.ubuntu.17.04_amd64.deb
2017-10-06 00:46:07 +02:00
sudo apt-get install -f
```
> Please note that `dpkg -i` will fail with unmet dependencies;
> the next command, `apt-get install -f` resolves these
> and then finishes configuring the PowerShell package.
### Uninstallation - Ubuntu 17.04
```sh
sudo apt-get remove powershell
```
2016-08-12 01:50:50 +02:00
2017-05-09 22:18:01 +02:00
## Debian 8
### Installation via Package Repository - Debian 8
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates).
This is the preferred method.
```sh
2017-10-06 00:46:07 +02:00
# Install system components
sudo apt-get update
sudo apt-get install curl apt-transport-https
2017-05-09 22:18:01 +02:00
# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
2017-10-06 00:46:07 +02:00
# Register the Microsoft Product feed
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-jessie-prod jessie main" > /etc/apt/sources.list.d/microsoft.list'
2017-05-09 22:18:01 +02:00
2017-10-06 00:46:07 +02:00
# Update the list of products
2017-05-09 22:18:01 +02:00
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
2017-10-24 20:13:17 +02:00
pwsh
2017-05-09 22:18:01 +02:00
```
After registering the Microsoft repository once as superuser,
from then on, you just need to use `sudo apt-get upgrade powershell` to update it.
### Installation via Direct Download - Debian 8
Download the Debian package
2017-10-25 01:28:22 +02:00
`powershell_6.0.0-beta.9-1.debian.8_amd64.deb`
2017-05-09 22:18:01 +02:00
from the [releases][] page onto the Debian machine.
Then execute the following in the terminal:
```sh
2017-10-25 01:28:22 +02:00
sudo dpkg -i powershell_6.0.0-beta.9-1.debian.8_amd64.deb
2017-05-09 22:18:01 +02:00
sudo apt-get install -f
```
> Please note that `dpkg -i` will fail with unmet dependencies;
> the next command, `apt-get install -f` resolves these
> and then finishes configuring the PowerShell package.
### Uninstallation - Debian 8
```sh
sudo apt-get remove powershell
```
2016-08-12 01:50:50 +02:00
2017-10-06 00:46:07 +02:00
## Debian 9
### Installation via Package Repository - Debian 9
PowerShell Core, for Linux, is published to package repositories for easy installation (and updates).
This is the preferred method.
```sh
# Install system components
sudo apt-get update
sudo apt-get install curl gnupg apt-transport-https
# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Product feed
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/microsoft.list'
# Update the list of products
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
2017-10-24 20:13:17 +02:00
pwsh
2017-10-06 00:46:07 +02:00
```
After registering the Microsoft repository once as superuser,
from then on, you just need to use `sudo apt-get upgrade powershell` to update it.
### Installation via Direct Download - Debian 9
Download the Debian package
2017-10-25 01:28:22 +02:00
`powershell_6.0.0-beta.9-1.debian.9_amd64.deb`
2017-10-06 00:46:07 +02:00
from the [releases][] page onto the Debian machine.
Then execute the following in the terminal:
```sh
2017-10-25 01:28:22 +02:00
sudo dpkg -i powershell_6.0.0-beta.9-1.debian.9_amd64.deb
2017-10-06 00:46:07 +02:00
sudo apt-get install -f
```
> Please note that `dpkg -i` will fail with unmet dependencies;
> the next command, `apt-get install -f` resolves these
> and then finishes configuring the PowerShell package.
### Uninstallation - Debian 9
```sh
sudo apt-get remove powershell
```
2017-03-21 23:20:11 +01:00
## CentOS 7
2016-07-27 21:55:10 +02:00
2017-05-09 22:18:01 +02:00
> This package also works on Oracle Linux 7.
2017-03-18 03:34:25 +01:00
2017-03-28 01:44:28 +02:00
### Installation via Package Repository (preferred) - CentOS 7
2017-03-25 00:46:05 +01:00
PowerShell Core for Linux is published to official Microsoft repositories for easy installation (and updates).
2017-03-18 03:34:25 +01:00
```sh
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
# Install PowerShell
sudo yum install -y powershell
# Start PowerShell
2017-10-24 20:13:17 +02:00
pwsh
2017-03-18 03:34:25 +01:00
```
After registering the Microsoft repository once as superuser,
2017-03-25 00:46:05 +01:00
you just need to use `sudo yum update powershell` to update PowerShell.
2017-03-18 03:34:25 +01:00
2017-03-28 01:44:28 +02:00
### Installation via Direct Download - CentOS 7
2017-03-18 03:34:25 +01:00
2016-08-12 01:50:50 +02:00
Using [CentOS 7][], download the RPM package
2017-10-25 01:28:22 +02:00
`powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm`
2016-08-12 01:50:50 +02:00
from the [releases][] page onto the CentOS machine.
2016-07-27 21:55:10 +02:00
Then execute the following in the terminal:
2016-03-31 08:29:16 +02:00
```sh
2017-10-25 01:28:22 +02:00
sudo yum install powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
2016-03-31 08:29:16 +02:00
```
2016-08-23 22:13:39 +02:00
You can also install the RPM without the intermediate step of downloading it:
```sh
2017-10-25 01:28:22 +02:00
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
2016-08-23 22:13:39 +02:00
```
2017-05-09 22:18:01 +02:00
### Uninstallation - CentOS 7
2016-09-13 06:12:00 +02:00
2016-09-20 01:34:23 +02:00
```sh
sudo yum remove powershell
```
2016-09-13 06:12:00 +02:00
2016-07-27 21:55:10 +02:00
[CentOS 7]: https://www.centos.org/download/
2017-05-09 22:18:01 +02:00
## Red Hat Enterprise Linux (RHEL) 7
### Installation via Package Repository (preferred) - Red Hat Enterprise Linux (RHEL) 7
PowerShell Core for Linux is published to official Microsoft repositories for easy installation (and updates).
```sh
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
# Install PowerShell
sudo yum install -y powershell
# Start PowerShell
2017-10-24 20:13:17 +02:00
pwsh
2017-05-09 22:18:01 +02:00
```
After registering the Microsoft repository once as superuser,
you just need to use `sudo yum update powershell` to update PowerShell.
### Installation via Direct Download - Red Hat Enterprise Linux (RHEL) 7
Download the RPM package
2017-10-25 01:28:22 +02:00
`powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm`
2017-05-09 22:18:01 +02:00
from the [releases][] page onto the Red Hat Enterprise Linux machine.
Then execute the following in the terminal:
```sh
2017-10-25 01:28:22 +02:00
sudo yum install powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
2017-05-09 22:18:01 +02:00
```
You can also install the RPM without the intermediate step of downloading it:
```sh
2017-10-25 01:28:22 +02:00
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
2017-05-09 22:18:01 +02:00
```
### Uninstallation - Red Hat Enterprise Linux (RHEL) 7
```sh
sudo yum remove powershell
```
2017-10-06 00:46:07 +02:00
## OpenSUSE 42.2
2017-04-05 02:41:40 +02:00
2017-10-06 00:46:07 +02:00
> **Note:** When installing PowerShell Core, OpenSUSE may report that nothing provides libcurl.
libcurl should already be installed on supported versions of OpenSUSE.
Run zypper search libcurl to confirm.
The error will present 2 'solutions'. Choose 'Solution 2' to continue installing PowerShell Core.
2017-04-05 02:41:40 +02:00
2017-10-06 00:46:07 +02:00
### Installation via Package Repository (preferred) - OpenSUSE 42.2
2017-04-05 02:41:40 +02:00
2017-10-06 00:46:07 +02:00
PowerShell Core for Linux is published to official Microsoft repositories for easy installation (and updates).
2017-04-05 02:41:40 +02:00
2017-10-06 00:46:07 +02:00
```sh
# Register the Microsoft signature key
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
# Add the Microsoft Product feed
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/zypp/repos.d/microsoft.repo
# Update the list of products
sudo zypper update
# Install PowerShell
sudo zypper install powershell
# Start PowerShell
2017-10-24 20:13:17 +02:00
pwsh
2017-10-06 00:46:07 +02:00
```
### Installation via Direct Download - OpenSUSE 42.2
2017-10-25 01:28:22 +02:00
Download the RPM package `powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm`
2017-10-06 00:46:07 +02:00
from the [releases][] page onto the OpenSUSE machine.
2017-04-05 02:41:40 +02:00
```sh
2017-04-11 22:37:53 +02:00
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
2017-10-25 01:28:22 +02:00
sudo zypper install powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
2017-04-05 02:41:40 +02:00
```
You can also install the RPM without the intermediate step of downloading it:
```sh
2017-04-11 22:37:53 +02:00
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
2017-10-25 01:28:22 +02:00
sudo zypper install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
2017-04-05 02:41:40 +02:00
```
2017-10-06 00:46:07 +02:00
### Uninstallation - OpenSUSE 42.2
2017-04-05 02:41:40 +02:00
```sh
sudo zypper remove powershell
```
2017-10-06 00:46:07 +02:00
## Fedora 25
### Installation via Package Repository (preferred) - Fedora 25
PowerShell Core for Linux is published to official Microsoft repositories for easy installation (and updates).
```sh
# Register the Microsoft signature key
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
# Update the list of products
sudo dnf update
# Install PowerShell
sudo dnf install -y powershell
# Start PowerShell
2017-10-24 20:13:17 +02:00
pwsh
2017-10-06 00:46:07 +02:00
```
### Installation via Direct Download - Fedora 25
Download the RPM package
2017-10-25 01:28:22 +02:00
`powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm`
2017-10-06 00:46:07 +02:00
from the [releases][] page onto the Red Hat Enterprise Linux machine.
Then execute the following in the terminal:
```sh
2017-10-25 01:28:22 +02:00
sudo dnf install powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
2017-10-06 00:46:07 +02:00
```
You can also install the RPM without the intermediate step of downloading it:
```sh
2017-10-25 01:28:22 +02:00
sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
2017-10-06 00:46:07 +02:00
```
### Uninstallation - Fedora 25
```sh
sudo dnf remove powershell
```
## Fedora 26
### Installation via Package Repository (preferred) - Fedora 26
PowerShell Core for Linux is published to official Microsoft repositories for easy installation (and updates).
```sh
# Register the Microsoft signature key
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
# Update the list of products
sudo dnf update
# Install a system component
sudo dnf install compat-openssl10
# Install PowerShell
sudo dnf install -y powershell
# Start PowerShell
2017-10-24 20:13:17 +02:00
pwsh
2017-10-06 00:46:07 +02:00
```
### Installation via Direct Download - Fedora 26
Download the RPM package
2017-10-25 01:28:22 +02:00
`powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm`
2017-10-06 00:46:07 +02:00
from the [releases][] page onto the Red Hat Enterprise Linux machine.
Then execute the following in the terminal:
```sh
sudo dnf update
sudo dnf install compat-openssl10
2017-10-25 01:28:22 +02:00
sudo dnf install powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
2017-10-06 00:46:07 +02:00
```
You can also install the RPM without the intermediate step of downloading it:
```sh
sudo dnf update
sudo dnf install compat-openssl10
2017-10-25 01:28:22 +02:00
sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
2017-10-06 00:46:07 +02:00
```
### Uninstallation - Fedora 26
```sh
sudo dnf remove powershell
```
2017-04-05 02:41:40 +02:00
2017-03-21 23:20:11 +01:00
## Arch Linux
2017-03-02 02:38:24 +01:00
2017-10-10 18:40:23 +02:00
PowerShell is available from the [Arch Linux][] User Repository (AUR).
* It can be compiled with the [latest tagged release][arch-release]
* It can be compiled from the [latest commit to master][arch-git]
* It can be installed using the [latest release binary][arch-bin]
2017-03-02 02:38:24 +01:00
Packages in the AUR are community maintained - there is no official support.
2017-10-10 18:40:23 +02:00
For more information on installing packages from the AUR, see the [Arch Linux wiki ](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages ) or the community [DockerFile ](https://github.com/PowerShell/PowerShell/blob/master/docker/community/archlinux/Dockerfile ).
2017-03-02 02:38:24 +01:00
[Arch Linux]: https://www.archlinux.org/download/
[arch-release]: https://aur.archlinux.org/packages/powershell/
[arch-git]: https://aur.archlinux.org/packages/powershell-git/
2017-10-10 18:40:23 +02:00
[arch-bin]: https://aur.archlinux.org/packages/powershell-bin/
2017-03-02 02:38:24 +01:00
2017-03-21 23:20:11 +01:00
## Linux AppImage
2016-08-23 02:37:43 +02:00
Using a recent Linux distribution,
2017-10-25 01:28:22 +02:00
download the AppImage `powershell-6.0.0-beta.9-x86_64.AppImage`
2016-08-23 02:37:43 +02:00
from the [releases][] page onto the Linux machine.
Then execute the following in the terminal:
2017-03-21 23:20:11 +01:00
```bash
2017-10-25 01:28:22 +02:00
chmod a+x powershell-6.0.0-beta.9-x86_64.AppImage
./powershell-6.0.0-beta.9-x86_64.AppImage
2016-08-23 02:37:43 +02:00
```
The [AppImage][] lets you run PowerShell without installing it.
It is a portable application that bundles PowerShell and its dependencies
(including .NET Core's system dependencies) into one cohesive package.
This package works independently of the user's Linux distribution,
and is a single binary.
[appimage]: http://appimage.org/
2017-05-10 18:49:02 +02:00
## macOS 10.12
2016-03-31 08:29:16 +02:00
2017-08-08 00:27:25 +02:00
### Installation via Homebrew (preferred) - macOS 10.12
[Homebrew][brew] is the missing package manager for macOS.
If the `brew` command is not found,
you need to install Homebrew following [their instructions][brew].
Once you've installed Homebrew, installing PowerShell is easy.
First, install [Homebrew-Cask][cask], so you can install more packages:
```sh
brew tap caskroom/cask
```
Now, you can install PowerShell:
```sh
brew cask install powershell
```
When new versions of PowerShell are released,
simply update Homebrew's formulae and upgrade PowerShell:
```sh
brew update
2017-08-25 20:02:48 +02:00
brew cask reinstall powershell
2017-08-08 00:27:25 +02:00
```
> Note: because of [this issue in Cask](https://github.com/caskroom/homebrew-cask/issues/29301), you currently have to do a reinstall to upgrade.
[brew]: http://brew.sh/
[cask]: https://caskroom.github.io/
### Installation via Direct Download - macOS 10.12
2017-05-10 18:49:02 +02:00
Using macOS 10.12, download the PKG package
2017-10-25 01:28:22 +02:00
`powershell-6.0.0-beta.9-osx.10.12-x64.pkg`
2016-09-03 02:16:35 +02:00
from the [releases][] page onto the macOS machine.
2016-07-27 21:55:10 +02:00
2016-08-12 01:50:50 +02:00
Either double-click the file and follow the prompts,
or install it from the terminal:
2016-04-11 18:50:58 +02:00
```sh
2017-10-25 01:28:22 +02:00
sudo installer -pkg powershell-6.0.0-beta.9-osx.10.12-x64.pkg -target /
2016-04-11 18:50:58 +02:00
```
2017-05-10 18:49:02 +02:00
### Uninstallation - macOS 10.12
2016-09-13 06:12:00 +02:00
2017-08-08 00:27:25 +02:00
If you installed PowerShell with Homebrew, uninstallation is easy:
2016-09-13 06:12:00 +02:00
2017-08-08 00:27:25 +02:00
```sh
brew cask uninstall powershell
```
If you installed PowerShell via direct download,
PowerShell must be removed manually:
2016-09-20 01:34:23 +02:00
2016-09-13 06:12:00 +02:00
```sh
2017-10-24 20:13:17 +02:00
sudo rm -rf /usr/local/bin/pwsh /usr/local/microsoft/powershell
2016-09-13 06:12:00 +02:00
```
2016-09-20 01:34:23 +02:00
To uninstall the additional PowerShell paths (such as the user profile path)
please see the [paths][paths] section below in this document
and remove the desired the paths with `sudo rm` .
2017-08-08 00:27:25 +02:00
(Note: this is not necessary if you installed with Homebrew.)
2016-09-13 06:12:00 +02:00
2016-09-20 23:10:40 +02:00
[paths]:#paths
2017-06-09 22:15:12 +02:00
## Kali
### Installation
```sh
# Install prerequisites
apt-get install libunwind8 libicu55
wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
# Install PowerShell
2017-10-25 01:28:22 +02:00
dpkg -i powershell_6.0.0-beta.9-1.ubuntu.16.04_amd64.deb
2017-06-09 22:15:12 +02:00
# Start PowerShell
2017-10-24 20:13:17 +02:00
pwsh
2017-06-09 22:15:12 +02:00
```
2017-06-25 21:15:06 +02:00
### Run PowerShell in latest Kali (Kali GNU/Linux Rolling) without installing it
```sh
# Grab the latest App Image
2017-10-25 01:28:22 +02:00
wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0-beta.9-x86_64.AppImage
2017-06-25 21:15:06 +02:00
# Make executable
2017-10-25 01:28:22 +02:00
chmod a+x powershell-6.0.0-beta.9-x86_64.AppImage
2017-06-25 21:15:06 +02:00
# Start PowerShell
2017-10-25 01:28:22 +02:00
./powershell-6.0.0-beta.9-x86_64.AppImage
2017-06-25 21:15:06 +02:00
```
2017-06-09 22:15:12 +02:00
### Uninstallation - Kali
```sh
2017-10-25 01:28:22 +02:00
dpkg -r powershell_6.0.0-beta.9-1.ubuntu.16.04_amd64.deb
2017-06-09 22:15:12 +02:00
```
2017-10-24 20:13:17 +02:00
## Binary Archives
PowerShell binary `tar.gz` archives are provided for macOS and Linux platforms to enable advanced deployment scenarios.
### Dependencies
For Linux, PowerShell builds portable binaries for all Linux distributions.
But .NET Core runtime requires different dependencies on different distributions,
and hence PowerShell does the same.
The following chart shows the .NET Core 2.0 dependencies on different Linux distributions that are officially supported.
| OS | Dependencies |
| ------------------ | ------------ |
| Ubuntu 14.04 | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, < br > libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu52 |
| Ubuntu 16.04 | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, < br > libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu55 |
| Ubuntu 17.04 | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, < br > libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu57 |
| Debian 8 (Jessie) | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, < br > libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.0, libicu52 |
| Debian 9 (Stretch) | libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, < br > libcurl3, libunwind8, libuuid1, zlib1g, libssl1.0.2, libicu57 |
| CentOS 7 < br > Oracle Linux 7 < br > RHEL 7 < br > OpenSUSE 42.2 < br > Fedora 25 | libunwind, libcurl, openssl-libs, libicu |
| Fedora 26 | libunwind, libcurl, openssl-libs, libicu, compat-openssl10 |
In order to deploy PowerShell binaries on Linux distributions that are not officially supported,
you would need to install the necessary dependencies for the target OS in separate steps.
For example, our [Amazon Linux dockerfile][amazon-dockerfile] installs dependencies first,
and then extracts the Linux `tar.gz` archive.
[amazon-dockerfile]: https://github.com/PowerShell/PowerShell/blob/master/docker/community/amazonlinux/Dockerfile
### Installation - Binary Archives
#### Linux
```sh
# Download the powershell '.tar.gz' archive
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0-beta.9-linux-x64.tar.gz
# Create the target folder where powershell will be placed
sudo mkdir -p /opt/microsoft/powershell/6.0.0-beta.9
# Expand powershell to the target folder
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.0.0-beta.9
# Create the symbolic link that points to pwsh
sudo ln -s /opt/microsoft/powershell/6.0.0-beta.9/pwsh /usr/bin/pwsh
```
#### macOS
```sh
# Download the powershell '.tar.gz' archive
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0-beta.9-osx-x64.tar.gz
# Create the target folder where powershell will be placed
sudo mkdir -p /usr/local/microsoft/powershell/6.0.0-beta.9
# Expand powershell to the target folder
sudo tar zxf /tmp/powershell.tar.gz -C /usr/local/microsoft/powershell/6.0.0-beta.9
# Create the symbolic link that points to pwsh
sudo ln -s /usr/local/microsoft/powershell/6.0.0-beta.9/pwsh /usr/local/bin/pwsh
```
### Uninstallation - Binary Archives
#### Linux
```sh
sudo rm -rf /usr/bin/pwsh /opt/microsoft/powershell
```
#### macOS
```sh
sudo rm -rf /usr/local/bin/pwsh /usr/local/microsoft/powershell
```
2017-03-21 23:20:11 +01:00
## Paths
2016-08-01 22:46:48 +02:00
2017-10-25 01:28:22 +02:00
* `$PSHOME` is `/opt/microsoft/powershell/6.0.0-beta.9/`
2016-08-11 23:26:33 +02:00
* User profiles will be read from `~/.config/powershell/profile.ps1`
* Default profiles will be read from `$PSHOME/profile.ps1`
* User modules will be read from `~/.local/share/powershell/Modules`
* Shared modules will be read from `/usr/local/share/powershell/Modules`
2016-08-12 01:50:50 +02:00
* Default modules will be read from `$PSHOME/Modules`
2017-03-28 01:44:28 +02:00
* PSReadline history will be recorded to `~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt`
2016-08-01 22:46:48 +02:00
2016-08-12 01:50:50 +02:00
The profiles respect PowerShell's per-host configuration,
so the default host-specific profiles exists at `Microsoft.PowerShell_profile.ps1` in the same locations.
2016-08-01 22:46:48 +02:00
2016-08-26 21:08:50 +02:00
On Linux and macOS, the [XDG Base Directory Specification][xdg-bds] is respected.
2016-08-02 01:32:16 +02:00
2016-08-26 21:08:50 +02:00
Note that because macOS is a derivation of BSD,
2016-08-12 01:50:50 +02:00
instead of `/opt` , the prefix used is `/usr/local` .
2017-10-25 01:28:22 +02:00
Thus, `$PSHOME` is `/usr/local/microsoft/powershell/6.0.0-beta.9/` ,
2017-10-24 20:13:17 +02:00
and the symlink is placed at `/usr/local/bin/pwsh` .
2016-08-02 01:33:47 +02:00
[releases]: https://github.com/PowerShell/PowerShell/releases/latest
[xdg-bds]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html