diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 922e12040..08429f3c8 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -266,24 +266,6 @@ "type": "windows-restart", "restart_timeout": "30m" }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Windows2016/Validate-SSDT.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Wix.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-WDK.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -464,12 +446,6 @@ "{{ template_dir }}/scripts/Installers/Install-WinAppDriver.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-WinAppDriver.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -661,48 +637,6 @@ "type": "windows-restart", "restart_timeout": "30m" }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Svn.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-SQLPowerShellTools.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-TypeScript.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Stack.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Zstd.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Vcpkg.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-VSWhere.ps1" - ] - }, { "type": "powershell", "scripts":[ diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index f7f414f3f..fd25e63a7 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -259,24 +259,6 @@ "type": "windows-restart", "restart_timeout": "10m" }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Wix.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Windows2019/Validate-SSDTExtensions.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-WDK.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -439,12 +421,6 @@ "{{ template_dir }}/scripts/Installers/Install-WinAppDriver.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-WinAppDriver.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -660,48 +636,6 @@ "type": "windows-restart", "restart_timeout": "10m" }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Svn.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-SQLPowerShellTools.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-TypeScript.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Stack.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Zstd.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Vcpkg.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-VSWhere.ps1" - ] - }, { "type": "powershell", "scripts":[ diff --git a/images/win/scripts/Installers/Install-Stack.ps1 b/images/win/scripts/Installers/Install-Stack.ps1 index bd3cabdae..d1e53ed5b 100644 --- a/images/win/scripts/Installers/Install-Stack.ps1 +++ b/images/win/scripts/Installers/Install-Stack.ps1 @@ -19,4 +19,6 @@ Extract-7Zip -Path $StackArchivePath -DestinationPath $DestinationPath New-Item -Name "x64.complete" -Path $StackToolcachePath -Add-MachinePathItem -PathItem $DestinationPath \ No newline at end of file +Add-MachinePathItem -PathItem $DestinationPath + +Invoke-PesterTests -TestFile "Tools" -TestName "Stack" diff --git a/images/win/scripts/Installers/Install-Svn.ps1 b/images/win/scripts/Installers/Install-Svn.ps1 index 315c4ef8a..caf601e72 100644 --- a/images/win/scripts/Installers/Install-Svn.ps1 +++ b/images/win/scripts/Installers/Install-Svn.ps1 @@ -4,3 +4,5 @@ ################################################################################ Choco-Install -PackageName svn + +Invoke-PesterTests -TestFile "Tools" -TestName "Svn" diff --git a/images/win/scripts/Installers/Install-TypeScript.ps1 b/images/win/scripts/Installers/Install-TypeScript.ps1 index 8b243ba5a..d413c1000 100644 --- a/images/win/scripts/Installers/Install-TypeScript.ps1 +++ b/images/win/scripts/Installers/Install-TypeScript.ps1 @@ -4,3 +4,5 @@ ################################################################################ npm install -g typescript + +Invoke-PesterTests -TestFile "Tools" -TestName "Typescript" diff --git a/images/win/scripts/Installers/Install-VSWhere.ps1 b/images/win/scripts/Installers/Install-VSWhere.ps1 index 5c623c936..641adedb8 100644 --- a/images/win/scripts/Installers/Install-VSWhere.ps1 +++ b/images/win/scripts/Installers/Install-VSWhere.ps1 @@ -4,3 +4,5 @@ ################################################################################ Choco-Install -PackageName vswhere + +Invoke-PesterTests -TestFile "Tools" -TestName "VSWhere" diff --git a/images/win/scripts/Installers/Install-Vcpkg.ps1 b/images/win/scripts/Installers/Install-Vcpkg.ps1 index d3a43424b..f4b44f98e 100644 --- a/images/win/scripts/Installers/Install-Vcpkg.ps1 +++ b/images/win/scripts/Installers/Install-Vcpkg.ps1 @@ -19,3 +19,5 @@ Invoke-Expression "$InstallDir\$VcpkgExecPath integrate install" Add-MachinePathItem $InstallDir $env:Path = Get-MachinePath setx VCPKG_INSTALLATION_ROOT $InstallDir /M + +Invoke-PesterTests -TestFile "Tools" -TestName "Vcpkg" diff --git a/images/win/scripts/Installers/Install-WDK.ps1 b/images/win/scripts/Installers/Install-WDK.ps1 index 67da3a324..54f08cc92 100644 --- a/images/win/scripts/Installers/Install-WDK.ps1 +++ b/images/win/scripts/Installers/Install-WDK.ps1 @@ -32,3 +32,5 @@ Install-Binary -Url $wdkUrl -Name "wdksetup.exe" -ArgumentList $argumentList # Need to install the VSIX to get the build targets when running VSBuild Install-VsixExtension -FilePath $FilePath -Name "WDK.vsix" -VSversion $VSver -InstallOnly + +Invoke-PesterTests -TestFile "WDK" diff --git a/images/win/scripts/Installers/Install-WinAppDriver.ps1 b/images/win/scripts/Installers/Install-WinAppDriver.ps1 index 92f957506..fc79ff993 100644 --- a/images/win/scripts/Installers/Install-WinAppDriver.ps1 +++ b/images/win/scripts/Installers/Install-WinAppDriver.ps1 @@ -10,3 +10,5 @@ $InstallerUrl = "https://github.com/Microsoft/WinAppDriver/releases/download/v1. [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Install-Binary -Url $InstallerUrl -Name $InstallerName + +Invoke-PesterTests -TestFile "WinAppDriver" diff --git a/images/win/scripts/Installers/Install-Wix.ps1 b/images/win/scripts/Installers/Install-Wix.ps1 index 25469dab8..63305f57f 100644 --- a/images/win/scripts/Installers/Install-Wix.ps1 +++ b/images/win/scripts/Installers/Install-Wix.ps1 @@ -21,3 +21,5 @@ else $extensionName = "Votive$VSver.vsix" #Installing VS extension 'Wix Toolset Visual Studio Extension' Install-VsixExtension -Url $extensionUrl -Name $extensionName -VSversion $VSver + +Invoke-PesterTests -TestFile "Wix" diff --git a/images/win/scripts/Installers/Install-Zstd.ps1 b/images/win/scripts/Installers/Install-Zstd.ps1 index 2251143bc..3770f0f1d 100644 --- a/images/win/scripts/Installers/Install-Zstd.ps1 +++ b/images/win/scripts/Installers/Install-Zstd.ps1 @@ -4,3 +4,5 @@ ################################################################################ Choco-Install -PackageName zstandard + +Invoke-PesterTests -TestFile "Tools" -TestName "Zstd" diff --git a/images/win/scripts/Installers/Validate-SQLPowerShellTools.ps1 b/images/win/scripts/Installers/Validate-SQLPowerShellTools.ps1 deleted file mode 100644 index 26dfeddcf..000000000 --- a/images/win/scripts/Installers/Validate-SQLPowerShellTools.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -# Validate the installation -$env:PSModulePath = Get-SystemVariable "PSModulePath" -$modules = Get-Module -Name SQLPS -ListAvailable -Write-Host "The SQLPS Modules present are:" -$modules | Select-Object Name,Version,Path | Format-Table - -# Validate the SQLserver PS module installation -$modules = Get-Module -Name SQLServer -ListAvailable -Write-Host "The SQLServer Modules present are:" -$modules | Select-Object Name,Version,Path | Format-Table diff --git a/images/win/scripts/Installers/Validate-Stack.ps1 b/images/win/scripts/Installers/Validate-Stack.ps1 deleted file mode 100644 index e52b54b21..000000000 --- a/images/win/scripts/Installers/Validate-Stack.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -################################################################################ -## File: Validate-Stack.ps1 -## Desc: Validate Stack for Windows -################################################################################ - -if (Get-Command -Name 'stack') -{ - Write-Host 'stack is on the path' -} -else -{ - Write-Host 'stack is not on path.' - exit 1 -} - diff --git a/images/win/scripts/Installers/Validate-Svn.ps1 b/images/win/scripts/Installers/Validate-Svn.ps1 deleted file mode 100644 index 775190b02..000000000 --- a/images/win/scripts/Installers/Validate-Svn.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -################################################################################ -## File: Validate-Svn.ps1 -## Desc: Validate Subversion -################################################################################ - -if (Get-Command -Name 'svn') -{ - Write-Host "Subversion $(svn --version --quiet) is on the path." -} -else -{ - Write-Host "Subversion is not on the path." - exit 1 -} diff --git a/images/win/scripts/Installers/Validate-TypeScript.ps1 b/images/win/scripts/Installers/Validate-TypeScript.ps1 deleted file mode 100644 index b498eceb5..000000000 --- a/images/win/scripts/Installers/Validate-TypeScript.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -################################################################################ -## File: Validate-TypeScript.ps1 -## Desc: Validate Typescript Installation -################################################################################ - -if (Get-Command -Name 'tsc') -{ - Write-Host "TypeScript $(tsc --version) is on the path." -} -else -{ - Write-Host "TypeScript is not on the path." - exit 1 -} diff --git a/images/win/scripts/Installers/Validate-VSWhere.ps1 b/images/win/scripts/Installers/Validate-VSWhere.ps1 deleted file mode 100644 index 850b5f268..000000000 --- a/images/win/scripts/Installers/Validate-VSWhere.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -################################################################################ -## File: Validate-VSWhere.ps1 -## Desc: Validate vswhere -################################################################################ - -if (Get-Command -Name 'vswhere') -{ - Write-Host "vswhere $(vswhere) on path" -} -else -{ - Write-Host "vswhere is not on path" - exit 1 -} diff --git a/images/win/scripts/Installers/Validate-Vcpkg.ps1 b/images/win/scripts/Installers/Validate-Vcpkg.ps1 deleted file mode 100644 index e10927f17..000000000 --- a/images/win/scripts/Installers/Validate-Vcpkg.ps1 +++ /dev/null @@ -1,27 +0,0 @@ -################################################################################ -## File: Validate-Vcpkg.ps1 -## Desc: Validate vcpkg Cli -################################################################################ - -if (Get-Command -Name 'Vcpkg') -{ - Write-Host 'Vcpkg is succesfully installed:' - vcpkg version | Write-Host -} -else -{ - Write-Host 'Vcpkg is not on PATH' - exit 1 -} - -if ($env:VCPKG_INSTALLATION_ROOT) -{ - Write-Host 'The VCPKG_INSTALLATION_ROOT environment variable is set' - Write-Host $env:VCPKG_INSTALLATION_ROOT -} -else -{ - Write-Host 'The VCPKG_INSTALLATION_ROOT environment variable is not set' - exit 1 -} - diff --git a/images/win/scripts/Installers/Validate-WDK.ps1 b/images/win/scripts/Installers/Validate-WDK.ps1 deleted file mode 100644 index dfb982495..000000000 --- a/images/win/scripts/Installers/Validate-WDK.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -################################################################################ -## File: Validate-WDK.ps1 -## Desc: Validate the installation of the Windows Driver Kit -################################################################################ - -function Get-WDKVersion -{ - $WDKVersion = (Get-CimInstance -ClassName Win32_Product -Filter "Name = 'Windows Driver Kit'").Version - - if (!$WDKVersion) - { - Write-Host "WDK was not found" - exit 1 - } -} - -Get-WDKVersion -$null = Get-VSExtensionVersion -packageName "Microsoft.Windows.DriverKit" - diff --git a/images/win/scripts/Installers/Validate-WinAppDriver.ps1 b/images/win/scripts/Installers/Validate-WinAppDriver.ps1 deleted file mode 100644 index ee1a6fc56..000000000 --- a/images/win/scripts/Installers/Validate-WinAppDriver.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -################################################################################ -## File: Validate-WinAppDriver.ps1 -## Desc: Validate WinAppDriver installation -################################################################################ - -$wad = "Windows Application Driver" -if (${env:ProgramFiles(x86)}) -{ - $wadPath = "${env:ProgramFiles(x86)}\$wad" -} -else -{ - $wadPath = "${env:ProgramFiles}\$wad" -} - -if (Test-Path $wadPath -PathType Any) -{ - Write-Host "WinAppDriver directory found." -} -else -{ - Write-Host "Failed to locate WinAppDriver directory. Exiting." - exit 1 -} - -#Validate if Developer Mode is enabled -$path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"; -if ((Get-ItemProperty -Path $path | Select-Object -ExpandProperty "AllowDevelopmentWithoutDevLicense") -eq 1) -{ - Write-Host "Developer Mode is successfully provisioned." -} -else -{ - Write-Host "Developer Mode was not successfully provisioned." - exit 1 -} - diff --git a/images/win/scripts/Installers/Validate-Wix.ps1 b/images/win/scripts/Installers/Validate-Wix.ps1 deleted file mode 100644 index 184a1bd70..000000000 --- a/images/win/scripts/Installers/Validate-Wix.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -################################################################################ -## File: Validate-Wix.ps1 -## Desc: Validate WIX. -################################################################################ - -Import-Module -Name ImageHelpers -Force - -function Get-WixVersion { - $regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" - $installedApplications = Get-ItemProperty -Path $regKey - $Version = ($installedApplications | Where-Object { $_.DisplayName -and $_.DisplayName.toLower().Contains("wix") } | Select-Object -First 1).DisplayVersion - return $Version -} - -$WixToolSetVersion = Get-WixVersion - -if ($WixToolSetVersion) { - Write-Host "Wix Toolset version" $WixPackage.version "installed" -} -else { - Write-Host "Wix Toolset is not installed" - exit 1 -} - -if (Test-IsWin19) -{ - $null = Get-VSExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev16" -} -else -{ - $null = Get-VSExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev15" -} - diff --git a/images/win/scripts/Installers/Validate-Zstd.ps1 b/images/win/scripts/Installers/Validate-Zstd.ps1 deleted file mode 100644 index d637b096f..000000000 --- a/images/win/scripts/Installers/Validate-Zstd.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -################################################################################ -## File: Validate-zstd.ps1 -## Desc: Validate zstd -################################################################################ - -if (Get-Command -Name 'zstd') -{ - Write-Host 'zstd on path' -} -else -{ - Write-Host 'zstd is not on path' - exit 1 -} - diff --git a/images/win/scripts/Installers/Windows2016/Install-SSDT.ps1 b/images/win/scripts/Installers/Windows2016/Install-SSDT.ps1 index 9d22e86dd..b39a547d2 100644 --- a/images/win/scripts/Installers/Windows2016/Install-SSDT.ps1 +++ b/images/win/scripts/Installers/Windows2016/Install-SSDT.ps1 @@ -16,4 +16,6 @@ Install-Binary -Url $InstallerUrl -Name $InstallerName -ArgumentList $ArgumentLi Write-Host "******** SSDT SETUP LOG START ********" Write-Host $(Get-Content $logFilePath | Out-String) -Write-Host "******** SSDT SETUP LOG END ********" \ No newline at end of file +Write-Host "******** SSDT SETUP LOG END ********" + +Invoke-PesterTests -TestFile "SSDTExtensions" diff --git a/images/win/scripts/Installers/Windows2016/Validate-SSDT.ps1 b/images/win/scripts/Installers/Windows2016/Validate-SSDT.ps1 deleted file mode 100644 index e7112db00..000000000 --- a/images/win/scripts/Installers/Windows2016/Validate-SSDT.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -################################################################################ -## File: Validate-SSDT.ps1 -## Desc: Validate SQL Server Data Tools for Windows -################################################################################ - -$null = Get-VSExtensionVersion -packageName "SSDT" - diff --git a/images/win/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1 b/images/win/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1 index 8c2a6cd7c..f678ab544 100644 --- a/images/win/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1 +++ b/images/win/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1 @@ -9,3 +9,4 @@ Install-VsixExtension -Url 'https://marketplace.visualstudio.com/_apis/public/ga 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/Installers/Windows2019/Validate-SSDTExtensions.ps1 b/images/win/scripts/Installers/Windows2019/Validate-SSDTExtensions.ps1 deleted file mode 100644 index 4cf24bed0..000000000 --- a/images/win/scripts/Installers/Windows2019/Validate-SSDTExtensions.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -## File: Validate-SSDTExtensions.ps1 -## Desc: Validate SQL Server Data Tools Visual Studio extensions -################################################################################ - -#These extensions don't have any proper name in the state.packages.json file, only id is available, which can be found on extension marketplace download page -$null = Get-VSExtensionVersion -packageName "04a86fc2-dbd5-4222-848e-911638e487fe" -$null = Get-VSExtensionVersion -packageName "851E7A09-7B2B-4F06-A15D-BABFCB26B970" -$null = Get-VSExtensionVersion -packageName "717ad572-c4b7-435c-c166-c2969777f718" diff --git a/images/win/scripts/Tests/SSDTExtensions.Tests.ps1 b/images/win/scripts/Tests/SSDTExtensions.Tests.ps1 new file mode 100644 index 000000000..7d1c6ee0b --- /dev/null +++ b/images/win/scripts/Tests/SSDTExtensions.Tests.ps1 @@ -0,0 +1,21 @@ +Describe "SSDTExtensions" { +#These extensions don't have any proper name in the state.packages.json file, only id is available, which can be found on extension marketplace download page + + if (Test-isWin19) { + $testExtenions = @( + @{id = "04a86fc2-dbd5-4222-848e-911638e487fe"} + @{id = "851E7A09-7B2B-4F06-A15D-BABFCB26B970"} + @{id = "717ad572-c4b7-435c-c166-c2969777f718"} + ) + + It "Extensions id=" -TestCases $testExtenions { + $version = Get-VSExtensionVersion -packageName "${id}" + $version | Should -Not -BeNullOrEmpty + } + } else { + It "Extension SSDT" { + $version = Get-VSExtensionVersion -packageName "SSDT" + $version | Should -Not -BeNullOrEmpty + } + } +} diff --git a/images/win/scripts/Tests/Tools.Tests.ps1 b/images/win/scripts/Tests/Tools.Tests.ps1 index dd2be77de..12278e43b 100644 --- a/images/win/scripts/Tests/Tools.Tests.ps1 +++ b/images/win/scripts/Tests/Tools.Tests.ps1 @@ -245,4 +245,48 @@ Describe "ServiceFabricSDK" { It "PowerShell Module" { Get-Module -Name ServiceFabric -ListAvailable | Should -Not -BeNullOrEmpty } -} \ No newline at end of file +} + +Describe "Svn" { + It "svn" { + "svn --version --quiet" | Should -ReturnZeroExitCode + } +} + +Describe "Stack" { + It "Stack" { + "stack --version" | Should -ReturnZeroExitCode + } +} + +Describe "Typescript" { + It "tsc" { + "tsc --version" | Should -ReturnZeroExitCode + } +} + +Describe "Vcpkg" { + It "vcpkg" { + "vcpkg version" | Should -ReturnZeroExitCode + } + + It "env variable VCPKG_INSTALLATION_ROOT is set" { + $env:VCPKG_INSTALLATION_ROOT | Should -Not -BeNullOrEmpty + } + + It "VCPKG_INSTALLATION_ROOT directory" { + $env:VCPKG_INSTALLATION_ROOT | Should -Exist + } +} + +Describe "VSWhere" { + It "vswhere" { + "vswhere" | Should -ReturnZeroExitCode + } +} + +Describe "Zstd" { + It "zstd" { + "zstd -V" | Should -ReturnZeroExitCode + } +} diff --git a/images/win/scripts/Tests/WDK.Tests.ps1 b/images/win/scripts/Tests/WDK.Tests.ps1 new file mode 100644 index 000000000..c67586e79 --- /dev/null +++ b/images/win/scripts/Tests/WDK.Tests.ps1 @@ -0,0 +1,11 @@ +Describe "WDK" { + It "WDK exists" { + $WDKVersion = (Get-CimInstance -ClassName Win32_Product -Filter "Name = 'Windows Driver Kit'").Version + $WDKVersion| Should -Not -BeNullOrEmpty + } + + It "WDK version from system" { + $version = Get-VSExtensionVersion -packageName "Microsoft.Windows.DriverKit" + $version | Should -Not -BeNullOrEmpty + } +} diff --git a/images/win/scripts/Tests/WinAppDriver.Tests.ps1 b/images/win/scripts/Tests/WinAppDriver.Tests.ps1 new file mode 100644 index 000000000..c33581e40 --- /dev/null +++ b/images/win/scripts/Tests/WinAppDriver.Tests.ps1 @@ -0,0 +1,10 @@ +Describe "WinAppDriver" { + It "WinAppDriver directory exists" { + Test-Path -Path "${env:ProgramFiles(x86)}\Windows Application Driver" | Should -BeTrue + } + + It "Developer Mode is enabled" { + $path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"; + Get-ItemProperty -Path $path | Select-Object -ExpandProperty "AllowDevelopmentWithoutDevLicense" | Should -Be 1 + } +} diff --git a/images/win/scripts/Tests/Wix.Tests.ps1 b/images/win/scripts/Tests/Wix.Tests.ps1 new file mode 100644 index 000000000..2a12261e2 --- /dev/null +++ b/images/win/scripts/Tests/Wix.Tests.ps1 @@ -0,0 +1,23 @@ +Describe "Wix" { + BeforeAll { + $regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" + $installedApplications = Get-ItemProperty -Path $regKey + $version = ($installedApplications | Where-Object { $_.DisplayName -and $_.DisplayName.toLower().Contains("wix") } | Select-Object -First 1).DisplayVersion + } + + It "Wix Toolset version from registry" { + $version | Should -Not -BeNullOrEmpty + } + + It "Wix Toolset version from system" { + if (Test-IsWin19) + { + $exVersion = Get-VSExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev16" + } + else + { + $exVersion = Get-VSExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev15" + } + $exVersion | Should -Not -BeNullOrEmpty + } +}