Note the order: even though validateScript processes the value of the parameter (and thus logically is dependent on the parameter’s value), it must be placed before the parameter name.
The following simple script ensures that the (only) parameter $path is specified and refers to an existing directory:
param (
[parameter ( mandatory=$true )] # make sure parameter exists
[validateScript( { test-path -pathType container $_ } )] # make sure path exists
[string ] $path # finally: the parameter
)
ls $path