8,329 questions
The error message "Missing ')' in function parameter list" is caused by the fact that the second parameter in the script is missing a comma to separate it from the first parameter. In PowerShell, parameters in a function or script must be separated by commas. To fix the error, add a comma after the first parameter like this:
param (
[switch]$push = $false,
[string]$string
)
This will allow the script to run without error and accept two parameters, a switch parameter named "push" with a default value of $false, and a string parameter named "string".
References: