Running PowerShell on your RaspberryPi

Posted by erwin on Thursday, December 6, 2018

For many years PowerShell was a Windows-only thing that was part of the closed Windows ecosystem. Now a days PowerShell is open source up at https://github.com/PowerShell with lots of docs and scripts, also open source.

PowerShell is supported on Windows, Mac, and a half-dozen Linux distros.

While running PowerShell on your RaspberryPi is still experimental and only supported for Raspbian Stretch it’s running pretty smoothly.

Installing

Install the prerequisites

    sudo apt-get install libunwind8

Grabbing the latest tar.gz

    wget https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-linux-arm32.tar.gz

Make folder to put powershell in mkdir ~/powershell

Unpack the tar.gz file to the powershell folder

    tar -xvf ./powershell-6.1.0-linux-arm32.tar.gz -C ~/powershell

Starting PowerShell

    ~/powershell/pwsh

Start PowerShell from bash with sudo to create a symbolic link

    sudo ~/powershell/pwsh -c New-Item -ItemType SymbolicLink -Path ``"/usr/bin/pwsh"`` -Target ``"\$PSHOME/pwsh"`` -Force

Alternatively you can run following to create a symbolic link sudo ln -s ~/powershell/pwsh /usr/bin/pwsh

Now to start PowerShell you can just run “pwsh”

Deleting PowerShell

    rm -rf ~/powershell

comments powered by Disqus