Sha256: 3be51cd307af5da5ba38a6ad67d77e85f63f254ed428b4d9c5b91061acb8a496
Contents?: true
Size: 1.71 KB
Versions: 9
Compression:
Stored size: 1.71 KB
Contents
# fail on errors and include uplift helpers $ErrorActionPreference = "Stop" Import-Module Uplift.Core Write-UpliftMessage "Validating Visual Studio install..." Write-UpliftEnv $productName = Get-UpliftEnvVariable "UPLF_VS_TEST_PRODUCT_NAME" $officeToolsPackageName = Get-UpliftEnvVariable "UPLF_VS_TEST_OFFICETOOLS_PACKAGE_NAME" Describe 'Visual Studio Install' { function Get-AppPackage($appName) { $result = @() $x32 = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* ` | Select-Object DisplayName, Name, DisplayVersion, Publisher, InstallDate ` | Sort-Object "DisplayName" ` | Where-Object { ($null -ne $_.DisplayName) -and $_.DisplayName.Contains($appName) } ` $x64 = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* ` | Select-Object DisplayName, Name, DisplayVersion, Publisher, InstallDate ` | Sort-Object "DisplayName" ` | Where-Object { ($null -ne $_.DisplayName) -and $_.DisplayName.Contains($appName) } ` $result += $x32 $result += $x64 return $result } function Confirm-AppPackageInstall($appName) { $app = Get-AppPackage $appName if($app.Count -gt 1) { # TODO, very nasty :) $app = $app[0] } $app.DisplayName | Should BeLike "*$appName*" } Context "Visual Studio App" { It "$productName" { Confirm-AppPackageInstall($productName) } } Context "Visual Studio Plugins" { It "$officeToolsPackageName" { Confirm-AppPackageInstall("$officeToolsPackageName") } } }
Version data entries
9 entries across 9 versions & 1 rubygems