Script Parameters / Arguments (for scripts, functions and script blocks) To pass arguments to a script or cmdlet type them separated by spaces:
You just have to know how to declare your parameters.
You can do the parameter validation using PowerShell.
ValidateNotNull only checks to see if the value being passed to the parameter is a null value.
Empty string is still valid.
ValidateNotNullorEmpty
This also checks to see if the value being passed is a null value and if it is an empty string or collection
Example
Function TestingMethod {
[cmdletbinding()]
Param(
[parameter(ValueFromPipeline)]
[ValidateNotNull()] #No value
$Item )
Process {
$Item
}
}