February 2019
Intermediate to advanced
626 pages
15h 51m
English
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.
Read now
Unlock full access