diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index be10ae37..622909b0 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -672,6 +672,12 @@ "{{ template_dir }}/scripts/Installers/Install-Kind.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-MongoDB.ps1" + ] + }, { "type": "windows-restart", "restart_timeout": "30m" @@ -995,6 +1001,12 @@ "{{ template_dir }}/scripts/Installers/Validate-Kind.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Validate-MongoDB.ps1" + ] + }, { "type": "powershell", "scripts":[ diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index d1c5ca01..dc303a19 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -657,6 +657,12 @@ "{{ template_dir }}/scripts/Installers/Install-RootCA.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-MongoDB.ps1" + ] + }, { "type": "windows-restart", "restart_timeout": "10m" @@ -974,6 +980,12 @@ "{{ template_dir }}/scripts/Installers/Validate-Kind.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Validate-MongoDB.ps1" + ] + }, { "type": "powershell", "scripts":[ diff --git a/images/win/scripts/Installers/Install-MongoDB.ps1 b/images/win/scripts/Installers/Install-MongoDB.ps1 new file mode 100644 index 00000000..d5638230 --- /dev/null +++ b/images/win/scripts/Installers/Install-MongoDB.ps1 @@ -0,0 +1,8 @@ +#################################################################################### +## File: Install-MongoDB.ps1 +## Desc: Install MongoDB +#################################################################################### + +choco install mongodb + +Add-MachinePathItem "$($env:SystemDrive)\Program Files\MongoDB\Server\4.2\bin" diff --git a/images/win/scripts/Installers/Validate-MongoDB.ps1 b/images/win/scripts/Installers/Validate-MongoDB.ps1 new file mode 100644 index 00000000..e0580b54 --- /dev/null +++ b/images/win/scripts/Installers/Validate-MongoDB.ps1 @@ -0,0 +1,38 @@ +################################################################################ +## File: Validate-MongoDB.ps1 +## Desc: Validate MongoDB +################################################################################ + +$command = Get-Command -Name 'mongod' +if($command) +{ + Write-Host "mongod is on path" +} +else +{ + Write-Host 'mongod not on path' + exit 1 +} + +$command = Get-Command -Name 'mongo' +if($command) +{ + Write-Host "mongo is on path" +} +else +{ + Write-Host 'mongo not on path' + exit 1 +} + +# Adding description of the software to Markdown +$SoftwareName = "MongoDB" +$version = $command.Version.ToString(); + +$Description = @" +_Version:_ $version
+_Environment:_ +* PATH: contains location of mongo.exe and mongod.exe +"@ + +Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description