Skip to content

Add ProviderNamespace property to PSResource #10271

Open
@fowl2

Description

@fowl2

Description of the new feature

Add a property to PSResource (as returned from Get-AzResource, etc.) called ProviderNamespace. Then we can pipe resources into the *-AzResourceProvider cmdlets.

This seems like a much less error prone and brittle than encoding knowledge of the ResourceType format into every script.

Proposed implementation details (optional)

Something to the effect the following, although I'm sure this isn't how you'd actually do it:

public class PSResource
{
    public string ProviderNamespace => this.ResourceType?.Split(new [] {'/'}, 2)?.FirstOrDefault();
}

Metadata

Metadata

Labels

ARM - CoreService AttentionThis issue is responsible by Azure service team.customer-reportedfeature-requestThis issue requires a new behavior in the product in order be resolved.needs-team-attentionThis issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions