Skip to content

Commit ba03909

Browse files
authored
Merge pull request #7442 from darshanhs90/preview1
fix provider operation commandlet
2 parents edd6562 + bfdd46f commit ba03909

File tree

5 files changed

+183
-137
lines changed

5 files changed

+183
-137
lines changed

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ProviderTests.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ function Test-AzureProviderOperation
9191
Assert-True { $insightsActions.Length -gt 0 }
9292
Assert-True { $allActions.Length -gt $insightsActions.Length }
9393

94+
# Get all operations of microsoft.eventgrid provider
95+
$eventgridActions = Get-AzureRmProviderOperation Microsoft.EventGrid/*
96+
$eventgridActions
97+
Assert-True { $eventgridActions.Length -gt 0 }
98+
Assert-True { $allActions.Length -gt $eventgridActions.Length }
99+
94100
# Filter non-Microsoft.Insights operations and match the lengths
95101
$nonInsightsActions = $allActions | Where-Object { $_.Operation.ToLower().StartsWith("microsoft.insights/") -eq $false }
96102
$actualLength = $allActions.Length - $nonInsightsActions.Length;

src/ResourceManager/Resources/Commands.Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ProviderTests/TestAzureProviderOperation.json

Lines changed: 164 additions & 122 deletions
Large diffs are not rendered by default.

src/ResourceManager/Resources/Commands.Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ProviderTests/TestAzureProviderOperationDataActions.json

Lines changed: 11 additions & 14 deletions
Large diffs are not rendered by default.

src/ResourceManager/Resources/Commands.Resources/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020
## Current Release
2121
* Add missing -Mode parameter to Set-AzureRmPolicyDefinition
22+
* Fix Get-AzureRmProviderOperation commandlet bug for operations with Origin containing User
2223

2324
## Version 6.5.0
2425
* Update New-AzureRmResourceGroupDeployment with new parameter RollbackAction

src/ResourceManager/Resources/Commands.Resources/Providers/GetAzureProviderOperationCmdlet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private static IEnumerable<PSResourceProviderOperation> GetPSOperationsFromProvi
137137

138138
private static bool IsUserOperation(ProviderOperation operation)
139139
{
140-
return operation.Origin == null || operation.Origin.Contains("user");
140+
return operation.Origin == null || operation.Origin.IndexOf("user", StringComparison.OrdinalIgnoreCase) > -1;
141141
}
142142
private static PSResourceProviderOperation ToPSResourceProviderOperation(ProviderOperation operation, string provider, string resource = null)
143143
{

0 commit comments

Comments
 (0)