Private/Invoke-OvfTest.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function Invoke-OvfTest {
    [cmdletbinding()]
    param(
        [parameter(Mandatory, ValueFromPipeline)]
        [pscustomobject[]]$OvfTestInfo,

        [parameter(Mandatory)]
        $Test
    )

    begin { }

    process {
        foreach ($ovfTest in $OvfTestInfo) {
            Write-Host -Object "`n"
            Write-Verbose -Message "Running OVF test [$($Test.ModuleName)][$($ovfTest.Name)]"
            $params = @{
                TestInfo = $ovfTest
                IncludePesterOutput = $IncludePesterOutput
                #Verbose = $false
            }

            if ($ovfTest.ScriptParameters) {
                if ($Test.Parameters.Keys.Count -gt 0) {                    
                    $params.Overrides = $Test.Parameters
                }
            }
            return (InvokeOperationValidation @params)
        }
    }

    end {}
}