Private/Invoke-PoshspecExpression.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#Private - Build the It scriptblock based on parameters from Get-PoshspecParam
function Invoke-PoshspecExpression {
    [CmdletBinding()]
    param(
        # Poshspec Param Object
        [Parameter(Mandatory, Position=0)]
        [PSCustomObject]
        $InputObject
    )
    
    It $InputObject.Name {
        Invoke-Expression $InputObject.Expression
    }    
}