Files
linux-workspace/install/pwsh.sh
2025-04-24 13:34:23 +02:00

28 lines
798 B
Bash
Executable File

#!/bin/bash
set -o errexit -o nounset -o pipefail
set -x
function pwsh_install_dotnet() {
# https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux#install-as-a-net-global-tool
dotnet tool install --global PowerShell
dotnet tool update --global PowerShell
}
function pwsh_install_apt() {
# https://learn.microsoft.com/en-us/powershell/scripting/install/install-debian
deb=/tmp/packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y wget apt-transport-https software-properties-common
source /etc/os-release
wget -O $deb "https://packages.microsoft.com/config/debian/$VERSION_ID/packages-microsoft-prod.deb"
sudo dpkg -i $deb
rm $deb
sudo apt-get update
sudo apt-get install -y powershell
}
pwsh_install_apt