Azure / Azure/azure-powershell

Add ProviderNamespace property to PSResource

Open
#10,271 1 comment 0 reactions 1 assignee Assigned to @ifeoluwaokunoren View on GitHub
act-identity-squad ARM - Core customer-reported feature-request needs-team-attention Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

## 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](https://github.com/MicrosoftDocs/azure-docs/issues/17996#issuecomment-541102990) 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();
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.