Skip to content

Commit a7a5677

Browse files
authored
Merge pull request #5292 from maddieclayton/operationsearchstring
Fix two issues around Get-AzureRmProviderOperation
2 parents 32d67b0 + 4ae92fa commit a7a5677

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

src/ResourceManager/Resources/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* Added ResourceGroup Completer to -ResourceGroup parameters allowing tab completion through resource groups in current subscription
2323
* Added -AsJob support for long-running Resources cmdlets. Allows selected cmdlets to run in the background and return a job to track and control progress.
2424
* Added alias from Get-AzureRmProviderOperation to Get-AzureRmResourceProviderAction to conform with naming conventions
25+
* Get-AzureRmProviderOperation: Added alias from -OperationSearchString to -Name and set default value of -OperationSearchString to "*", which will return all provider operations.
2526

2627
## Version 5.1.1
2728
* Fixed issue where Get-AzureRMRoleAssignment would result in a assignments without roledefiniton name for custom roles

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function Test-AzureProvider-WithZoneMappings
8282
function Test-AzureProviderOperation
8383
{
8484
# Get all operations by all providers
85-
$allActions = Get-AzureRmProviderOperation *
85+
$allActions = Get-AzureRmProviderOperation
8686
Assert-True { $allActions.Length -gt 0 }
8787

8888
# Get all operations of microsoft.insights provider

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ public class GetAzureProviderOperationCommand : ResourcesBaseCmdlet
3737
/// <summary>
3838
/// Gets or sets the provider namespace
3939
/// </summary>
40-
[Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = false, ValueFromPipeline = true, HelpMessage = "The action string.")]
40+
[Parameter(Position = 0, Mandatory = false, ValueFromPipelineByPropertyName = false, ValueFromPipeline = true, HelpMessage = "The action string.")]
41+
[Alias("Name")]
4142
[ValidateNotNullOrEmpty]
42-
public string OperationSearchString { get; set; }
43+
public string OperationSearchString { get; set; } = "*";
4344

4445
/// <summary>
4546
/// Executes the cmdlet

src/ResourceManager/Resources/Commands.Resources/help/Get-AzureRmProviderOperation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Gets the operations for an Azure resource provider that are securable using Azur
1414
## SYNTAX
1515

1616
```
17-
Get-AzureRmProviderOperation [-OperationSearchString] <String> [-DefaultProfile <IAzureContextContainer>]
17+
Get-AzureRmProviderOperation [[-OperationSearchString] <String>] [-DefaultProfile <IAzureContextContainer>]
1818
[<CommonParameters>]
1919
```
2020

@@ -67,11 +67,11 @@ The operation search string (with possible wildcard (*) characters)
6767
```yaml
6868
Type: String
6969
Parameter Sets: (All)
70-
Aliases:
70+
Aliases: Name
7171

72-
Required: True
72+
Required: False
7373
Position: 0
74-
Default value: None
74+
Default value: "*"
7575
Accept pipeline input: True (ByValue)
7676
Accept wildcard characters: False
7777
```

0 commit comments

Comments
 (0)