How can I user a parameterFilter with a switch parameter when mocking in Pester?

Question:

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:

to no avail.

Answer:

Try this:

Source:

How can I user a parameterFilter with a switch parameter when mocking in Pester? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply