Switch pwsh install script to apt packages
This commit is contained in:
24
scripts/pwsh-install.sh
Normal file → Executable file
24
scripts/pwsh-install.sh
Normal file → Executable file
@@ -1,8 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#install-as-a-net-global-tool
|
set -o errexit -o nounset -o pipefail
|
||||||
dotnet tool install --global PowerShell
|
set -x
|
||||||
dotnet tool update --global PowerShell
|
|
||||||
|
|
||||||
# https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1
|
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-ubuntu
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y wget apt-transport-https software-properties-common
|
||||||
|
wget -O /tmp/packages-microsoft-prod.deb "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
|
||||||
|
sudo dpkg -i /tmp/packages-microsoft-prod.deb
|
||||||
|
rm /tmp/packages-microsoft-prod.deb
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y powershell
|
||||||
|
}
|
||||||
|
|
||||||
|
pwsh_install_apt
|
||||||
|
|||||||
Reference in New Issue
Block a user