2020-10-07 13:49:40 +05:00
|
|
|
#!/bin/bash -e
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
2023-11-22 21:49:23 +01:00
|
|
|
## File: install-powershell.sh
|
|
|
|
|
## Desc: Install PowerShell Core
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
|
|
|
|
|
2023-12-29 12:36:27 +01:00
|
|
|
# Source the helpers for use with the script
|
2022-11-21 19:56:42 +01:00
|
|
|
source $HELPER_SCRIPTS/install.sh
|
2024-04-26 23:18:26 +02:00
|
|
|
source $HELPER_SCRIPTS/os.sh
|
2022-11-21 19:56:42 +01:00
|
|
|
|
2023-12-29 12:36:27 +01:00
|
|
|
pwsh_version=$(get_toolset_value .pwsh.version)
|
2022-11-21 19:56:42 +01:00
|
|
|
|
2022-05-18 14:39:37 +02:00
|
|
|
# Install Powershell
|
2024-04-26 23:18:26 +02:00
|
|
|
if is_ubuntu24; then
|
|
|
|
|
dependency_path=$(download_with_retry "http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu72_72.1-3ubuntu2_amd64.deb")
|
|
|
|
|
sudo dpkg -i "$dependency_path"
|
|
|
|
|
package_path=$(download_with_retry "https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/powershell-lts_7.4.2-1.deb_amd64.deb")
|
|
|
|
|
sudo dpkg -i "$package_path"
|
|
|
|
|
else
|
2024-05-29 13:43:07 +02:00
|
|
|
apt-get install powershell=$pwsh_version*
|
2024-04-26 23:18:26 +02:00
|
|
|
fi
|