Sha256: fa9bff854378d00808521c4dc7d43204f9f9a1853d8367a8c951a513233d9621

Contents?: true

Size: 1.72 KB

Versions: 9

Compression:

Stored size: 1.72 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

Version Path
vagrant-uplift-0.2.1902.49 lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1
vagrant-uplift-0.2.1902.46 lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1
vagrant-uplift-0.2.1902.42 lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1
vagrant-uplift-0.2.1902.40 lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1
vagrant-uplift-0.2.1902.39 lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1
vagrant-uplift-0.2.1902.37 lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1
vagrant-uplift-0.2.1902.32 lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1
vagrant-uplift-0.2.1902.19 lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1
vagrant-uplift-0.2.1902.18 lib/scripts/vagrant/uplift.vagrant.visual_studio17/tests/vs17.dsc.Tests.ps1