diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index bb871b3c..6aa1423c 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -182,10 +182,14 @@ }, { "type": "powershell", + "environment_vars":[ + "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" + ], "scripts":[ "{{ template_dir }}/scripts/Installers/Install-Nuget.ps1", "{{ template_dir }}/scripts/Installers/Install-Wix.ps1", - "{{ template_dir }}/scripts/Installers/Install-WDK.ps1" + "{{ template_dir }}/scripts/Installers/Install-WDK.ps1", + "{{ template_dir }}/scripts/Installers/Install-Vsix.ps1" ] }, { diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index b66d64c5..515caba9 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -189,11 +189,14 @@ }, { "type": "powershell", + "environment_vars":[ + "TOOLSET_JSON_PATH={{user `toolset_json_path`}}" + ], "scripts":[ "{{ template_dir }}/scripts/Installers/Install-Nuget.ps1", "{{ template_dir }}/scripts/Installers/Install-Wix.ps1", - "{{ template_dir }}/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1", "{{ template_dir }}/scripts/Installers/Install-WDK.ps1", + "{{ template_dir }}/scripts/Installers/Install-Vsix.ps1", "{{ template_dir }}/scripts/Installers/Install-AzureCli.ps1", "{{ template_dir }}/scripts/Installers/Install-AzureDevOpsCli.ps1", "{{ template_dir }}/scripts/Installers/Install-AzCopy.ps1", diff --git a/images/win/scripts/Installers/Install-Vsix.ps1 b/images/win/scripts/Installers/Install-Vsix.ps1 new file mode 100644 index 00000000..4e6062a2 --- /dev/null +++ b/images/win/scripts/Installers/Install-Vsix.ps1 @@ -0,0 +1,20 @@ +################################################################################### +## File: Install-Vsix.ps1 +## Desc: Install the Visual Studio Extensions from toolset.json +################################################################################### + +$ErrorActionPreference = "Stop" + +$toolset = Get-ToolsetContent +$vsixPackagesList = $toolset.visualStudio.vsix +if (-not $vsixPackagesList) { + Write-Host "No extensions to install" + exit 0 +} + +$vsVersion = $toolset.visualStudio.Version +$vsixPackagesList | ForEach-Object { + Install-VsixExtension -Url $_.url -Name $_.name -VSversion $vsVersion +} + +Invoke-PesterTests -TestFile "Vsix" \ No newline at end of file diff --git a/images/win/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1 b/images/win/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1 deleted file mode 100644 index f678ab54..00000000 --- a/images/win/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -################################################################################### -## File: Install-SSDTExtensions.ps1 -## Desc: Install the extensions previously known as SSDT package -################################################################################### - -Import-Module -Name ImageHelpers -Force - -Install-VsixExtension -Url 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftAnalysisServicesModelingProjects/2.9.5/vspackage' -Name 'Microsoft.DataTools.AnalysisServices.vsix' -VSversion "2019" -Install-VsixExtension -Url 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/SSIS/vsextensions/SqlServerIntegrationServicesProjects/3.4/vspackage' -Name 'Microsoft.DataTools.IntegrationServices.exe' -VSversion "2019" -Install-VsixExtension -Url 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftReportProjectsforVisualStudio/2.6.3/vspackage' -Name 'Microsoft.DataTools.ReportingServices.vsix' -VSversion "2019" - -Invoke-PesterTests -TestFile "SSDTExtensions" diff --git a/images/win/scripts/Tests/Vsix.Tests.ps1 b/images/win/scripts/Tests/Vsix.Tests.ps1 new file mode 100644 index 00000000..b92f862e --- /dev/null +++ b/images/win/scripts/Tests/Vsix.Tests.ps1 @@ -0,0 +1,13 @@ +Describe "Vsix" { + $toolset = Get-ToolsetContent + $requiredVsixs = $toolset.visualStudio.vsix + + $allPackages = (Get-VSSetupInstance | Select-VsSetupInstance -Product *).Packages + $testCases = $requiredVsixs | ForEach-Object { @{ VsixId = $_.Id; AllPackages = $allPackages }} + if ($testCases.Count -gt 0) { + It "Extension " -TestCases $testCases { + $objVsix = $AllPackages | Where-Object { $_.id -eq $VsixId } + $objVsix | Should -Not -BeNullOrEmpty + } + } +} \ No newline at end of file diff --git a/images/win/toolsets/toolset-2016.json b/images/win/toolsets/toolset-2016.json index a76246e6..c764e080 100644 --- a/images/win/toolsets/toolset-2016.json +++ b/images/win/toolsets/toolset-2016.json @@ -227,6 +227,8 @@ "Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre", "Microsoft.VisualStudio.Component.Workflow", "Microsoft.VisualStudio.Workload.Office" + ], + "vsix": [ ] } } diff --git a/images/win/toolsets/toolset-2019.json b/images/win/toolsets/toolset-2019.json index a2a7ec4a..7184dc03 100644 --- a/images/win/toolsets/toolset-2019.json +++ b/images/win/toolsets/toolset-2019.json @@ -259,6 +259,28 @@ "Microsoft.VisualStudio.Workload.VisualStudioExtension", "Component.MDD.Linux", "Component.MDD.Linux.GCC.arm" + ], + "vsix": [ + { + "name": "Microsoft.DataTools.AnalysisServices.vsix", + "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftAnalysisServicesModelingProjects/2.9.5/vspackage", + "id": "04a86fc2-dbd5-4222-848e-911638e487fe" + }, + { + "name": "Microsoft.DataTools.IntegrationServices.exe", + "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/SSIS/vsextensions/SqlServerIntegrationServicesProjects/3.4/vspackage", + "id": "851E7A09-7B2B-4F06-A15D-BABFCB26B970" + }, + { + "name": "Microsoft.DataTools.ReportingServices.vsix", + "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftReportProjectsforVisualStudio/2.6.3/vspackage", + "id": "717ad572-c4b7-435c-c166-c2969777f718" + }, + { + "name": "Microsoft.VisualStudio.Installer.Projects.vsix", + "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/VisualStudioClient/vsextensions/MicrosoftVisualStudio2017InstallerProjects/latest/vspackage", + "id": "VSInstallerProjects" + } ] } }