From 80d3b3ade1b5c65ec816184ff69e10b0f2e3f4a5 Mon Sep 17 00:00:00 2001 From: EdTheDev Date: Sat, 13 Mar 2021 15:46:30 -0600 Subject: [PATCH 1/1] Powershell 7 for Pi --- install/install-powershell-6-pi.sh | 19 ------------------- install/pi_powershell7.sh | 25 +++++++++++++++++++++++++ install/powershell.sh | 8 ++------ setup/powershell.sh | 6 ++++++ 4 files changed, 33 insertions(+), 25 deletions(-) delete mode 100755 install/install-powershell-6-pi.sh create mode 100644 install/pi_powershell7.sh create mode 100644 setup/powershell.sh diff --git a/install/install-powershell-6-pi.sh b/install/install-powershell-6-pi.sh deleted file mode 100755 index 1a2e2a4..0000000 --- a/install/install-powershell-6-pi.sh +++ /dev/null @@ -1,19 +0,0 @@ -echo "Install PowerShell 6.2.0" - -if [ ! -d /opt/powershell ]; then - -cd /tmp -wget https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-linux-arm32.tar.gz -mkdir /opt/powershell -tar -xvf ./powershell-6.2.0-linux-arm32.tar.gz -C /opt/powershell - -echo "PowerShell is now at /opt/powershell/pswsh" -echo "Remember to update your path." - -fi - -ln -s /opt/powershell/pwsh /usr/bin/pwsh -ls /usr/bin/pwsh -alis -chmod 755 -R /opt/powershell/pwsh -rm /opt/powershell/DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY - diff --git a/install/pi_powershell7.sh b/install/pi_powershell7.sh new file mode 100644 index 0000000..0127478 --- /dev/null +++ b/install/pi_powershell7.sh @@ -0,0 +1,25 @@ + +## https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#raspbian + + +################################### +# Prerequisites + +# Update package lists +sudo apt-get update + +# Install libunwind8 and libssl1.0 +# Regex is used to ensure that we do not install libssl1.0-dev, as it is a variant that is not required +sudo apt-get install '^libssl1.0.[0-9]$' libunwind8 -y + +################################### +# Download and extract PowerShell + +# Grab the latest tar.gz +wget https://github.com/PowerShell/PowerShell/releases/download/v7.1.2/powershell-7.1.2-linux-arm32.tar.gz + +# Make folder to put powershell +mkdir /etc/powershell + +# Unpack the tar.gz file +tar -xvf ./powershell-7.1.2-linux-arm32.tar.gz -C /etc/powershell \ No newline at end of file diff --git a/install/powershell.sh b/install/powershell.sh index 0f7b2eb..038e76a 100755 --- a/install/powershell.sh +++ b/install/powershell.sh @@ -1,8 +1,4 @@ -## Setup PowerShell if [ ! -f ~/.config/powershell/Microsoft.PowerShell_profile.ps1 ]; then - echo "************** Install PowerShell and setup profile" + echo "************** Install PowerShell" sudo apt-get install powershell - chsh --shell /usr/bin/pwsh - mkdir -p ~/.config/powershell/ - ln -s ~/dotfiles/Microsoft.PowerShell_profile.ps1 ~/.config/powershell/Microsoft.PowerShell_profile.ps1 -fi +fi \ No newline at end of file diff --git a/setup/powershell.sh b/setup/powershell.sh new file mode 100644 index 0000000..a1d2c0e --- /dev/null +++ b/setup/powershell.sh @@ -0,0 +1,6 @@ +if [ ! -f ~/.config/powershell/Microsoft.PowerShell_profile.ps1 ]; then + echo "************** Link PowerShell profile" + chsh --shell /usr/bin/pwsh + mkdir -p ~/.config/powershell/ + ln -s ~/dotfiles/Microsoft.PowerShell_profile.ps1 ~/.config/powershell/Microsoft.PowerShell_profile.ps1 +fi \ No newline at end of file -- 2.47.3