2024-08-27 16:04:11 -04:00

32 lines
992 B
Plaintext
Executable File

#!/usr/bin/with-contenv bash
source /etc/lsb-release
if [ -f "/powershell/powershell.tar.gz" ]; then
echo "Installing PowerShell"
if [ "${DISTRIB_CODENAME}" == "bionic" ]; then
echo "\
libicu60 \
libunwind8" >> /mod-repo-packages-to-install.list
elif [ "${DISTRIB_CODENAME}" == "focal" ]; then
echo "\
libicu66 \
libunwind8" >> /mod-repo-packages-to-install.list
elif [ "${DISTRIB_CODENAME}" == "jammy" ]; then
echo "\
libicu70 \
libunwind8" >> /mod-repo-packages-to-install.list
elif [ "${DISTRIB_CODENAME}" == "noble" ]; then
echo "\
libicu74 \
libunwind8" >> /mod-repo-packages-to-install.list
fi
tar xf "/powershell/powershell.tar.gz" -C /powershell
rm -rf \
/powershell/powershell.tar.gz
ln -s /powershell/pwsh /usr/bin/pwsh
chmod +x /powershell/pwsh
else
echo "PowerShell already installed, skipping"
fi