]> apps.delaporte.us Git - dotfiles.git/blob - install/powershell7_pi.sh
Hide any GitHub issue that was updated today.
[dotfiles.git] / install / powershell7_pi.sh
1
2 ## https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#raspbian
3
4
5 ###################################
6 # Prerequisites
7
8 # Update package lists
9 sudo apt-get update
10
11 # Install libunwind8 and libssl1.0
12 # Regex is used to ensure that we do not install libssl1.0-dev, as it is a variant that is not required
13 sudo apt-get install '^libssl1.0.[0-9]$' libunwind8 -y
14
15 ###################################
16 # Download and extract PowerShell
17
18 # Grab the latest tar.gz
19 if [ ! -f /tmp/powershell.tar.gz ]; then
20 wget https://github.com/PowerShell/PowerShell/releases/download/v7.1.2/powershell-7.1.2-linux-arm32.tar.gz -O /tmp/powershell.tar.gz
21 fi
22
23 # Make folder to put powershell
24 mkdir -p /opt
25 mkdir -p /opt/powershell
26
27 # Unpack the tar.gz file
28 tar -xvf /tmp/powershell.tar.gz -C /opt/powershell/
29
30 # Link the shell to the usual place to find it.
31 ln -s /opt/powershell/pwsh /usr/bin/pwsh
32 echo "/usr/bin/pwsh" >> /etc/shells
33
34 echo "PowerShell should now be installed. See ./setup/powershell.sh for how to chagne shells."