February 2019
Intermediate to advanced
626 pages
15h 51m
English
AllowEmptyCollection, as the name suggests, allows an empty array to be assigned to a mandatory parameter:
function Test-AllowEmptyCollection { [CmdletBinding()] param ( [Parameter(Mandatory)] [AllowEmptyCollection()] [Object[]]$Parameter1 )}
This will allow the command to be called with an explicitly empty array:
Test-AllowEmptyCollection -Parameter1 @()
Read now
Unlock full access