Open
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 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();
}