From 901de9d87ab8337481a249c03d37ebba523d5976 Mon Sep 17 00:00:00 2001 From: Justin Walsh <49404281+Justin-Walsh@users.noreply.github.com> Date: Tue, 21 Sep 2021 18:52:08 -0400 Subject: [PATCH] Add Azure PS modules (#33) --- windows.ltsc2019/Dockerfile | 8 +++++++- windows.ltsc2019/spec/windows.ltsc2019.tests.ps1 | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/windows.ltsc2019/Dockerfile b/windows.ltsc2019/Dockerfile index ddc3128..71bbca7 100644 --- a/windows.ltsc2019/Dockerfile +++ b/windows.ltsc2019/Dockerfile @@ -7,6 +7,7 @@ ARG Aws_Cli_Version=2.0.60 ARG Aws_Iam_Authenticator_Version=0.5.3 ARG Aws_Powershell_Version=4.1.2 ARG Azure_Cli_Version=2.14.0 +ARG Azure_Powershell_Version=4.5.0 ARG Eks_Cli_Version=0.25.0 ARG Google_Cloud_Cli_Version=339.0.0 ARG Helm_Version=3.3.0 @@ -45,11 +46,16 @@ RUN choco install awscli -y --version $Env:Aws_Cli_Version --no-progress # Install the AWS IAM Authenticator RUN choco install aws-iam-authenticator -y --version $Env:Aws_Iam_Authenticator_Version --no-progress -# # Install AWS PowerShell module +# # Install AWS PowerShell modules # # https://docs.aws.amazon.com/powershell/latest/userguide/pstools-getting-set-up-windows.html#ps-installing-awspowershellnetcore RUN Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force; ` Install-Module -name AWSPowerShell.NetCore -RequiredVersion $Env:Aws_Powershell_Version -Force +#Install Azure PowerShell modules +# https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-3.6.1 +RUN Install-Module -Force -Name Az -AllowClobber -Scope AllUsers -MaximumVersion $Env:Azure_Powershell_Version; ` + Enable-AzureRmAlias -Scope LocalMachine + # # Install NodeJS RUN choco install nodejs-lts -y --version $Env:Node_Version --no-progress diff --git a/windows.ltsc2019/spec/windows.ltsc2019.tests.ps1 b/windows.ltsc2019/spec/windows.ltsc2019.tests.ps1 index a6872a2..0bdbdb3 100644 --- a/windows.ltsc2019/spec/windows.ltsc2019.tests.ps1 +++ b/windows.ltsc2019/spec/windows.ltsc2019.tests.ps1 @@ -31,6 +31,10 @@ Describe 'installed dependencies' { $output.'azure-cli' | Should -Be '2.14.0' $LASTEXITCODE | Should -be 0 } + + It 'has az powershell module installed' { + (Get-Module Az -ListAvailable).Version.ToString() | should -be '4.5.0' + } It 'has aws cli installed' { aws --version 2>&1 | Should -Match '2.0.60'