Skip to content

Get-AzDelegation returns an error when null #13180

Open
@anwather

Description

@anwather
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Network - Virtual NetworkService AttentionThis issue is responsible by Azure service team.customer-reportedquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions