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

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