AllowNull is used to permit explicit use of $null as a value for a Mandatory parameter:
function Test-AllowNull {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[AllowNull()]
[Object]$Parameter1
)
}
AllowNull is effective for array parameters, and for parameters that use Object as a type. AllowNull is not effective for string parameters as the null value is cast to an empty string, and an empty string is still not permitted.