If your param($p) is not the first line in your script that can cause the Param error.
Make sure your param($p) is the first line.
If your param($p) is not the first line in your script that can cause the Param error.
Make sure your param($p) is the first line.