From ef9ababfbb024a80ac40aee0f16ee007968a11aa Mon Sep 17 00:00:00 2001 From: joeyaiello Date: Mon, 22 May 2017 10:42:29 -0700 Subject: [PATCH 1/5] add Homebrew to install docs --- docs/installation/linux.md | 54 +++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/docs/installation/linux.md b/docs/installation/linux.md index ffc67e1d5d2..2b0879cad72 100644 --- a/docs/installation/linux.md +++ b/docs/installation/linux.md @@ -339,6 +339,28 @@ and is a single binary. ## macOS 10.12 +### 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. +Just install [Homebrew-Cask][cask] and then you can install PowerShell: + +When new versions of PowerShell are released, +simply update Homebrew's formulae and upgrade PowerShell: + +```sh +brew update +brew upgrade powershell +``` + +[brew]: http://brew.sh/ +[cask]: https://caskroom.github.io/ + +### Installation via Direct Download - macOS 10.12 + Using macOS 10.12, download the PKG package `powershell-6.0.0-beta.2-osx.10.12-x64.pkg` from the [releases][] page onto the macOS machine. @@ -352,9 +374,14 @@ sudo installer -pkg powershell-6.0.0-beta.2-osx.10.12-x64.pkg -target / ### Uninstallation - macOS 10.12 -PowerShell on MacOS must be removed manually. +If you PowerShell with Homebrew, uninstallation is easy: -To remove the installed package: +```sh +brew uninstall powershell +``` + +If you installed PowerShell via direct download, +PowerShell must be removed manually: ```sh sudo rm -rf /usr/local/bin/powershell /usr/local/microsoft/powershell @@ -363,28 +390,26 @@ sudo rm -rf /usr/local/bin/powershell /usr/local/microsoft/powershell 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`. +(Note: this is not necessary if you installed with Homebrew.) [paths]:#paths -## OpenSSL +### OpenSSL on macOS + +On macOS, .NET Core requires Homebrew's OpenSSL +because the "OpenSSL" system libraries on macOS are not OpenSSL, +as Apple deprecated OpenSSL in favor of their own libraries. +This requirement is not a hard requirement for all of PowerShell. +However, most networking functions (such as `Invoke-WebRequest`) +do require OpenSSL to work properly. -Also install [Homebrew's OpenSSL][openssl]: +The easiest fix is to install [Homebrew's OpenSSL][openssl]: ```bash brew install openssl brew install curl --with-openssl ``` -[Homebrew][brew] is the missing package manager for macOS. -If the `brew` command was not found, -you need to install Homebrew following [their instructions][brew]. - -.NET Core requires Homebrew's OpenSSL because the "OpenSSL" system libraries on macOS are not OpenSSL, -as Apple deprecated OpenSSL in favor of their own libraries. -This requirement is not a hard requirement for all of PowerShell; -however, most networking functions (such as `Invoke-WebRequest`) -do require OpenSSL to work properly. - **Please ignore** .NET Core's installation instructions to manually link the OpenSSL libraries. This is **not** required for PowerShell as we patch .NET Core's cryptography libraries to find Homebrew's OpenSSL in its installed location. Again, **do not** run `brew link --force` nor `ln -s` for OpenSSL, regardless of other instructions. @@ -407,7 +432,6 @@ and the build script patches the libraries on-the-fly when building from source. You *can* run this command manually if you're having trouble with .NET Core's cryptography libraries. [openssl]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/openssl.rb -[brew]: http://brew.sh/ [homebrew-patch]: https://github.com/Homebrew/brew/pull/597 ## Paths From 616b8557a3dc129eca8e8868eb850ac13592415a Mon Sep 17 00:00:00 2001 From: joeyaiello Date: Tue, 23 May 2017 15:07:39 -0700 Subject: [PATCH 2/5] add missing install instructions --- docs/installation/linux.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/installation/linux.md b/docs/installation/linux.md index 2b0879cad72..140af4f9066 100644 --- a/docs/installation/linux.md +++ b/docs/installation/linux.md @@ -348,6 +348,11 @@ you need to install Homebrew following [their instructions][brew]. Once you've installed Homebrew, installing PowerShell is easy. Just install [Homebrew-Cask][cask] and then you can install PowerShell: +```sh +brew tap caskroom/cask +brew cask install powershell +``` + When new versions of PowerShell are released, simply update Homebrew's formulae and upgrade PowerShell: From 85f5c5e2b7404add1c0e883c91bd848ae312d519 Mon Sep 17 00:00:00 2001 From: joeyaiello Date: Thu, 25 May 2017 10:13:30 -0700 Subject: [PATCH 3/5] add 'cask' to macOS uninstall --- docs/installation/linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/linux.md b/docs/installation/linux.md index 140af4f9066..ab74798f6a7 100644 --- a/docs/installation/linux.md +++ b/docs/installation/linux.md @@ -382,7 +382,7 @@ sudo installer -pkg powershell-6.0.0-beta.2-osx.10.12-x64.pkg -target / If you PowerShell with Homebrew, uninstallation is easy: ```sh -brew uninstall powershell +brew cask uninstall powershell ``` If you installed PowerShell via direct download, From 1e9fea1bb522e926f709acb63a0c8a851928bda5 Mon Sep 17 00:00:00 2001 From: joeyaiello Date: Tue, 6 Jun 2017 11:29:12 -0700 Subject: [PATCH 4/5] address PR comments on Mac install --- docs/installation/linux.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/installation/linux.md b/docs/installation/linux.md index ab74798f6a7..15ea6b5dd4b 100644 --- a/docs/installation/linux.md +++ b/docs/installation/linux.md @@ -346,10 +346,15 @@ 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. -Just install [Homebrew-Cask][cask] and then you can install PowerShell: +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 ``` @@ -379,7 +384,7 @@ sudo installer -pkg powershell-6.0.0-beta.2-osx.10.12-x64.pkg -target / ### Uninstallation - macOS 10.12 -If you PowerShell with Homebrew, uninstallation is easy: +If you installed PowerShell with Homebrew, uninstallation is easy: ```sh brew cask uninstall powershell @@ -408,7 +413,11 @@ This requirement is not a hard requirement for all of PowerShell. However, most networking functions (such as `Invoke-WebRequest`) do require OpenSSL to work properly. -The easiest fix is to install [Homebrew's OpenSSL][openssl]: +The PowerShell formula for Homebrew includes this OpenSSL as a dependency, +so you if you installed via Homebrew, you shouldn't run into these problems. + +If you installed via direct download (or through some means other than Homebrew), +the easiest fix for these issues is to install [Homebrew's OpenSSL][openssl]: ```bash brew install openssl From 0b8d157670327196408025bd7a2d4ee4438a216e Mon Sep 17 00:00:00 2001 From: joeyaiello Date: Tue, 27 Jun 2017 10:31:12 -0700 Subject: [PATCH 5/5] move to cask reinstall for update --- docs/installation/linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/installation/linux.md b/docs/installation/linux.md index 15ea6b5dd4b..bd058553f44 100644 --- a/docs/installation/linux.md +++ b/docs/installation/linux.md @@ -363,9 +363,11 @@ simply update Homebrew's formulae and upgrade PowerShell: ```sh brew update -brew upgrade powershell +brew reinstall powershell ``` +> 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/