Here's a good tutorial on Powershell params:
PowerShell ABC's - P is for Parameters
Basically, you should use a param
statement on the first line of the script
param([type]$p1 = , [type]$p2 = , ...)
or use the $args built-in variable, which is auto-populated with all of the args.