Open
Description
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Get-AzDelegation 3.3.0 Az.Network
When I run the command as below an error is returned (the delegation does not exist) :-
Get-AzDelegation -Name nmeFunction -Subnet $subnet
Get-AzDelegation : Sequence contains no matching element
At line:1 char:1
+ Get-AzDelegation -Name nmeFunction -Subnet $subnet
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzDelegation], InvalidOperationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Network.GetAzureDelegation
Would it be better if $null
is returned instead when an object doesn't exist?