Using Pester, I'm mocking an advanced function which takes, amongst other parameters, a switch. How do I create a -parameterFilter
for the mock which includes the switch parameter?
I've tried:
-parameterFilter { $Domain -eq 'MyDomain' -and $Verbose -eq $true }
-parameterFilter { $Domain -eq 'MyDomain' -and $Verbose }
-parameterFilter { $Domain -eq 'MyDomain' -and $Verbose -eq 'True' }
to no avail.
Try this:
-parameterFilter { $Domain -eq 'MyDomain' -and $Verbose.IsPresent}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With