To access command-line arguments used when starting a script use the automatic variable $args. You can cycle through the individual arguments in the $args collection by using code similar to this:
foreach ($i in $args) {$i}
To access a particular argument use the collection index number, with 0 representing the first item in the collection, 1 representing the second item, etc:
$args{0]
You can reference the last item in a collection by using the index number –1: