Добавил скрипт установки powershell
This commit is contained in:
parent
668bc135dd
commit
c49ff7d359
44
install-powershell.sh
Normal file
44
install-powershell.sh
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
POWERSHELL_VERSION="7.4.2"
|
||||||
|
|
||||||
|
# Предварительные требования
|
||||||
|
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y wget apt-transport-https software-properties-common
|
||||||
|
|
||||||
|
source /etc/os-release
|
||||||
|
|
||||||
|
function Install-Ubuntu {
|
||||||
|
# Download the PowerShell package file
|
||||||
|
wget https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell_${POWERSHELL_VERSION}-1.deb_amd64.deb
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# Install the PowerShell package
|
||||||
|
dpkg -i powershell_${POWERSHELL_VERSION}-1.deb_amd64.deb
|
||||||
|
|
||||||
|
# Resolve missing dependencies and finish the install (if necessary)
|
||||||
|
apt-get install -f
|
||||||
|
|
||||||
|
# Delete the downloaded package file
|
||||||
|
rm powershell_${POWERSHELL_VERSION}-1.deb_amd64.deb
|
||||||
|
}
|
||||||
|
|
||||||
|
function Install-Rhel {
|
||||||
|
dnf install https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-1.rh.x86_64.rpm
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! command -v pwsh &> /dev/null
|
||||||
|
then
|
||||||
|
echo "Powershell не установлен"
|
||||||
|
|
||||||
|
if [ "$ID" = "ubuntu" ]; then
|
||||||
|
Install-Ubuntu
|
||||||
|
elif [ $"ID" = "redos" ]; then
|
||||||
|
Install-Rhel
|
||||||
|
else
|
||||||
|
echo "Установите powershell для вашей ОС $NAME, чтобы воспользоваться скриптом установки ЛЭРС"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Powershell установлен"
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user