diff --git a/images/linux/scripts/installers/azpowershell.sh b/images/linux/scripts/installers/azpowershell.sh index 47ac5ff3e..13253b5fa 100644 --- a/images/linux/scripts/installers/azpowershell.sh +++ b/images/linux/scripts/installers/azpowershell.sh @@ -8,12 +8,8 @@ source $HELPER_SCRIPTS/os.sh # List of versions -if isUbuntu20 ; then - versions=$(pwsh -Command '(Find-Module -Name Az).Version') -else - toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json" - versions=$(jq -r '.azureModules[] | select(.name | contains("az")) | .versions[]' $toolset) -fi +toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json" +versions=$(jq -r '.azureModules[] | select(.name | contains("az")) | .versions[]' $toolset) # Try to install and update PowerShellGet before the actual installation pwsh -Command "Install-Module -Name PowerShellGet -Force" diff --git a/images/linux/toolsets/toolset-2004.json b/images/linux/toolsets/toolset-2004.json index c52fcb406..2985f9589 100644 --- a/images/linux/toolsets/toolset-2004.json +++ b/images/linux/toolsets/toolset-2004.json @@ -69,6 +69,14 @@ {"name": "MarkdownPS"}, {"name": "Pester"} ], + "azureModules": [ + { + "name": "az", + "versions": [ + "4.7.0" + ] + } + ], "apt": { "common_packages": [ "dbus",