diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index ccfdf0cc0..b65a98798 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -193,6 +193,12 @@ "elevated_user": "{{user `install_user`}}", "elevated_password": "{{user `install_password`}}" }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Nuget.ps1" + ] + }, { "type": "windows-restart", "restart_timeout": "30m" diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 77935fd76..56287703c 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -193,6 +193,12 @@ "elevated_user": "{{user `install_user`}}", "elevated_password": "{{user `install_password`}}" }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Install-Nuget.ps1" + ] + }, { "type": "powershell", "scripts":[ diff --git a/images/win/scripts/Installers/Install-Nuget.ps1 b/images/win/scripts/Installers/Install-Nuget.ps1 new file mode 100644 index 000000000..6c5e5e4a6 --- /dev/null +++ b/images/win/scripts/Installers/Install-Nuget.ps1 @@ -0,0 +1,16 @@ +################################################################################ +## File: Install-Nuget.ps1 +## Desc: Install NuGet.CommandLine +################################################################################ + +Choco-Install -PackageName NuGet.CommandLine + +if (Get-Command -Name 'nuget.exe') +{ + Write-Host 'nuget on path' +} +else +{ + Write-Host 'nuget is not on path' + exit 1 +} diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 95b73a2f5..d7e864bb8 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -127,6 +127,10 @@ function Get-ComposerVersion { return "Composer $composerVersion" } +function Get-NugetVersion { + (nuget help) -match "NuGet Version" -replace "Version: " +} + function Get-AntVersion { ($(ant -version) | Out-String) -match "version (?\d+\.\d+\.\d+)" | Out-Null $antVersion = $Matches.Version diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index a72ab7e52..26fc2cd06 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -48,7 +48,8 @@ $markdown += New-MDList -Style Unordered -Lines @( (Get-CondaVersion), (Get-RubyGemsVersion), (Get-HelmVersion), - (Get-ComposerVersion) + (Get-ComposerVersion), + (Get-NugetVersion) ) $markdown += New-MDHeader "Project Management" -Level 3