Merge pull request #2053 from akv-platform/al-cheb/add-ubuntu-pwsh71

[Ubuntu20] Swap Ubuntu-20.04 powershell installation from snap to official package
This commit is contained in:
Maxim Lobanov
2020-11-13 14:45:53 +03:00
committed by GitHub
2 changed files with 1 additions and 17 deletions

View File

@@ -4,9 +4,6 @@
## Desc: Installed Azure PowerShell ## Desc: Installed Azure PowerShell
################################################################################ ################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/os.sh
# List of versions # List of versions
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json" toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
versions=$(jq -r '.azureModules[] | select(.name | contains("az")) | .versions[]' $toolset) versions=$(jq -r '.azureModules[] | select(.name | contains("az")) | .versions[]' $toolset)
@@ -18,10 +15,6 @@ pwsh -Command "Update-Module -Name PowerShellGet -Force"
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) # Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
for version in ${versions[@]}; do for version in ${versions[@]}; do
pwsh -Command "Save-Module -Name Az -LiteralPath /usr/share/az_$version -RequiredVersion $version -Force -Verbose" pwsh -Command "Save-Module -Name Az -LiteralPath /usr/share/az_$version -RequiredVersion $version -Force -Verbose"
if isUbuntu20; then
rm -rf "/usr/share/az_$version/Az.Accounts"
pwsh -Command "Save-Module -Name Az.Accounts -LiteralPath /usr/share/az_$version -RequiredVersion 1.9.5 -Force -Verbose"
fi
done done
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected

View File

@@ -4,17 +4,8 @@
## Desc: Installs powershellcore ## Desc: Installs powershellcore
################################################################################ ################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/os.sh
# Install Powershell # Install Powershell
if isUbuntu20 ; then apt-get install -y powershell
snap install powershell --classic --channel=edge/useedge
fi
if isUbuntu16 || isUbuntu18 ; then
apt-get install -y powershell
fi
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"