diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index af9bb028..5baec7c1 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -682,6 +682,12 @@ "{{ template_dir }}/scripts/Installers/Install-MongoDB.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1" + ] + }, { "type": "windows-restart", "restart_timeout": "30m" @@ -998,6 +1004,12 @@ "{{ template_dir }}/scripts/Installers/Validate-MongoDB.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Validate-GoogleCloudSDK.ps1" + ] + }, { "type": "powershell", "scripts":[ diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 6651f1c0..8f512506 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -667,6 +667,12 @@ "{{ template_dir }}/scripts/Installers/Install-MongoDB.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1" + ] + }, { "type": "windows-restart", "restart_timeout": "10m" @@ -989,6 +995,12 @@ "{{ template_dir }}/scripts/Installers/Validate-AliyunCli.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Validate-GoogleCloudSDK.ps1" + ] + }, { "type": "powershell", "scripts":[ diff --git a/images/win/scripts/Installers/Install-GoogleCloudSDK.ps1 b/images/win/scripts/Installers/Install-GoogleCloudSDK.ps1 new file mode 100644 index 00000000..eb75707f --- /dev/null +++ b/images/win/scripts/Installers/Install-GoogleCloudSDK.ps1 @@ -0,0 +1,9 @@ +################################################################################ +## File: Install-GoogleCloudSDK.ps1 +## Desc: Install Google Cloud SDK +################################################################################ + +# https://cloud.google.com/sdk/docs/downloads-interactive +$googleCloudSDKInstaller = "https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe" +$argumentList = @("/S", "/allusers", "/noreporting") +Install-Binary -Url $googleCloudSDKInstaller -Name "GoogleCloudSDKInstaller.exe" -ArgumentList $argumentList diff --git a/images/win/scripts/Installers/Validate-GoogleCloudSDK.ps1 b/images/win/scripts/Installers/Validate-GoogleCloudSDK.ps1 new file mode 100644 index 00000000..6bc348f3 --- /dev/null +++ b/images/win/scripts/Installers/Validate-GoogleCloudSDK.ps1 @@ -0,0 +1,19 @@ +################################################################################ +## File: Validate-GoogleCloudSDK.ps1 +## Desc: Validate Install Google Cloud SDK for Windows +################################################################################ + +# Simple validation gcloud, gsutil, and bq command line tools +$validateTools = @("bq", "gcloud", "gsutil") +foreach($tool in $validateTools) +{ + if (Get-Command -Name $tool) + { + Write-Host "$tool on path" + } + else + { + Write-Host "$tool is not on path" + exit 1 + } +} diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 646a3518..1d380743 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -101,7 +101,8 @@ $markdown += New-MDList -Style Unordered -Lines @( (Get-AWSSAMVersion), (Get-AlibabaCLIVersion), (Get-CloudFoundryVersion), - (Get-HubVersion) + (Get-HubVersion), + (Get-GoogleCloudSDKVersion) ) $markdown += New-MDHeader "Browsers and webdrivers" -Level 3 diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 0fcb5e3a..5093a803 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -202,4 +202,8 @@ function Get-StackVersion { ((stack --version --quiet) | Out-String) -match "Version (?\d+\.\d+\.\d+)," | Out-Null $stackVersion = $Matches.Version return "Stack $stackVersion" +} + +function Get-GoogleCloudSDKVersion { + (gcloud --version) -match "Google Cloud SDK" } \ No newline at end of file