Azure / Azure/azure-powershell
Add ProviderNamespace property to PSResource
- 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
Assessment
This issue has not been assessed yet.