Setup a PowerShell 7.1 dev-environment on macOS ‚Blur‘

Recently I had to reset my old (2013) Macbook Pro and reinstalled the OS on it. After the last step – installing the latest update „blur“ – I thought its a good moment to setup PowerShell 7.1 and VS-Code. Learn below how I did it.

Install PowerShell 7.1

1.) Download Powershell from GitHub.

Bildschirmfoto 2020-11-15 um 13.04.39.png
Bildschirmfoto 2020-11-15 um 13.05.24.png

2.) Open Terminal and run the installation commands

sudo installer -pkg powershell-7.1.0-osx-x64.pkg -target /

Bildschirmfoto 2020-11-15 um 13.08.45.png
Bildschirmfoto 2020-11-15 um 13.09.20.png

Type „pwsh“ on the codlin and you sould get this:

Bildschirmfoto 2020-11-15 um 13.15.29.png

Install OpenSSL

https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-7.1#installing-dependencies

Bildschirmfoto 2020-11-15 um 13.12.15.png
Bildschirmfoto 2020-11-15 um 13.12.33.png
Bildschirmfoto 2020-11-15 um 13.13.23.png

1.) Install the MacPorts as described here:

Exit Terminal once and restart the Terminal, otherwise the next command will fail.

sudo port selfupdate

Bildschirmfoto 2020-11-15 um 13.29.56.png

2.) Get the latest version of ‚port‘

sudo port upgrade outdated

Bildschirmfoto 2020-11-15 um 13.31.07.png
Bildschirmfoto 2020-11-15 um 13.31.25.png
Bildschirmfoto 2020-11-15 um 13.48.13.png

3.) Create the links

<code>sudo mkdir -p /usr/local/opt/openssl</code>

sudo ln -s /opt/local/lib/openssl-1.0 /usr/local/opt/openssl/lib

Install some great PowerShell tools for the comand line

Install-module posh-git # to see branches in git
Install-module oh-my-posh # great command line tool
Import-module oh-my-posh # run it

Activate predictive Intelligence in PSReadline:

Set-PSReadLineOption -PredictionSource History

Bildschirmfoto 2020-11-15 um 15.35.44.png

Install VS Code

Download VS-Code from here. After the download you find the file in your download folder.

Bildschirmfoto 2020-11-15 um 13.52.11.png

Move it to your Programs folder, so that you can run it from „Finder“

Pasted Graphic.tiff

Click on Extensions and install the PowerShell extension

Bildschirmfoto 2020-11-15 um 13.57.40.png
Bildschirmfoto 2020-11-15 um 13.59.09.png

DONE ! Enjoy PowerShell on your Mac!

R.