When Powershell function won’t work: you define them with commas and parentheses, but call them with spaces and no parentheses
Posted by jpluimers on 2019/08/15
The function or command was called as if it were a method. Parameters should be separated by spaces. For information about parameters, see the about_Parameters Help topic.
Every now and then I bump into the above error. The reason is this:
- Functions are defined with commas between parameters and parentheses around them
- One-parameter functions can be called with one parameter surrounded by parentheses
- Multi-parameter functions need to be called with spaces between parameters and no parentheses surrounding them
Confused? #MeToo
The problem: [WayBack] about_Parameters_Default_Values | Microsoft Docs
Based on [WayBack] Powershell function won’t work.
–jeroen
Leave a Reply