Axiom/src/Verify-Like.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function Verify-Like {
    param (
        [Parameter(ValueFromPipeline=$true)]
        $Actual,
        [Parameter(Mandatory=$true,Position=0)]
        $Expected
    )

    if ($Actual -notlike $Expected) {
        $message = "Expected is not present in Actual!`n"+
        "Expected: '$Expected'`n"+
        "Actual : '$Actual'" 

        throw [Exception]$message
    }
    
    $Actual
}