AzureAD / azure-activedirectory-powershell

This is a repo for Azure AD PowerShell scrips and samples
30 stars 27 forks source link

AzureADPreview - 'All' parameter of Get-AzureADUser behaves like a "boolean parameter" rather than a "switch parameter" #28

Open heidarj opened 3 years ago

heidarj commented 3 years ago

Using the AzureADPreview module, version 2.0.2.136 I notice that the 'All' parameter of Get-AzureADUser behaves like a "boolean parameter" rather than a "switch parameter".

That is to say this:

Get-AzureADUser -All

throws this error:

Get-AzureADUser : Missing an argument for parameter 'All'. Specify a parameter of type 'System.Nullable`1[System.Boolean]' and try again.

The only way to use the 'All' parameter is by providing a boolean value:

Get-AzureADUser -All:$true
heidarj commented 3 years ago

Microsoft documentation about "Advanced Function Parameters" states:

Switch parameters are easy to use and are preferred over Boolean parameters, which have a more difficult syntax.