Consider the following code:
function Test { [CmdletBinding()] param ( [parameter(Mandatory=$true)] [AllowNull()] [String
You also need to add the [AllowEmptyString()] attribute if you plan on allowing nulls and empty strings.
[AllowEmptyString()]
function Test { [CmdletBinding()] param ( [parameter(Mandatory=$true)] [AllowNull()] [AllowEmptyString()] [String] $ComputerName ) process{} } Test -ComputerName $null