-
Notifications
You must be signed in to change notification settings - Fork 4k
Handle invalid locations for Get-AzureRmResourceProvider. #2380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -89,5 +91,38 @@ public override void ExecuteCmdlet() | |||
this.WriteObject(providers, enumerateCollection: true); | |||
} | |||
} | |||
|
|||
private PSResourceProvider[] ListPSResourceProviders() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed PS stands for PowerShell, its good to call it ListPowerShellResourceProviders
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add summary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PowerShell practice is in preference to PS abbreviation. For example, the base class PSObject, PSCustomObject. Here I think we can follow the practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PowerShell practice is in preference to PS abbreviation. For example, the base class PSObject, PSCustomObject. Here I think we can follow the practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to to PR, but I believe this was checked in few weeks ago - in correct summary Refers to: src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Providers/GetAzureProviderCmdlet.cs:47 in 0c03564. [](commit_id = 0c03564, deletion_comment = False) |
foreach (var provider in providers) | ||
{ | ||
provider.ResourceTypes = provider.ResourceTypes | ||
.Where(type => !type.Locations.Any() || type.Locations.Any(loc => loc.EqualsAsLocation(this.Location))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check type.Locations not null before type.Locations.Any()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix this.
Fix issue #2218.