Powershell function with multiple scriptblock parameters

Question:

I have been unable to create a Powershell function that accepts more than one scriptblock parameter. Here’s the simplified test script. What is the issue with multiple scriptblocks?

This produces the following output:

Answer:

Your problem is that you are using parentheses and commas when calling functions, a common mistake in powershell.

These should work:

Source:

Powershell function with multiple scriptblock parameters by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply