diff --git a/images/win/scripts/Installers/Install-AWS.ps1 b/images/win/scripts/Installers/Install-AWS.ps1 index 23a5c4d4d..59feea232 100644 --- a/images/win/scripts/Installers/Install-AWS.ps1 +++ b/images/win/scripts/Installers/Install-AWS.ps1 @@ -15,3 +15,14 @@ else Write-Host 'awscli is not on path' exit 1 } + +$sessionManagerName = "SessionManagerPluginSetup.exe" +$sessionManagerUrl = "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/windows/$sessionManagerName" +Install-Binary -Url $sessionManagerUrl -Name $sessionManagerName -ArgumentList ("/silent", "/install") +$env:Path = $env:Path + ";$env:ProgramFiles\Amazon\SessionManagerPlugin\bin" + +$sessionMessage = session-manager-plugin +Write-Host "$sessionMessage" +if ($sessionMessage -notmatch "*plugin was installed successfully*") { + exit 1 +} \ No newline at end of file diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 6e643fcf0..b1ba9152a 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -100,6 +100,7 @@ $markdown += New-MDList -Style Unordered -Lines @( (Get-AzureDevopsExtVersion), (Get-AWSCLIVersion), (Get-AWSSAMVersion), + (Get-AWSSessionManagerVersion), (Get-AlibabaCLIVersion), (Get-CloudFoundryVersion), (Get-HubVersion), diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 2a096ca15..ba1d5f9a4 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -146,7 +146,7 @@ function Get-AzCopyVersion { } function Get-AzureDevopsExtVersion { - $azureDevExtVersion = (az version | ConvertFrom-Json | Foreach{ $_."extensions" })."azure-devops" + $azureDevExtVersion = (az version | ConvertFrom-Json | ForEach-Object { $_."extensions" })."azure-devops" return "Azure DevOps CLI extension $azureDevExtVersion" } @@ -162,6 +162,11 @@ function Get-AWSSAMVersion { return "AWS SAM CLI $awssamVersion" } +function Get-AWSSessionManagerVersion { + $awsSessionManagerVersion = $(session-manager-plugin --version) + return "AWS Session Manager CLI $awsSessionManagerVersion" +} + function Get-AlibabaCLIVersion { $alicliVersion = $(aliyun version) return "Alibaba Cloud CLI $alicliVersion"