Skip to content

Commit 40ff809

Browse files
author
Hovsep
committed
Merge pull request Azure#2136 from gandhiniraj/dev
Add default parameter for Remove-AzureRmResourceLock and Get-AzureRmProviderOperation
2 parents 3b8d521 + 857b4ee commit 40ff809

File tree

4 files changed

+183
-176
lines changed

4 files changed

+183
-176
lines changed

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Lock/RemoveAzureResourceLockCmdlet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2020
/// <summary>
2121
/// The remove azure resource lock cmdlet.
2222
/// </summary>
23-
[Cmdlet(VerbsCommon.Remove, "AzureRmResourceLock", SupportsShouldProcess = true), OutputType(typeof(PSObject))]
23+
[Cmdlet(VerbsCommon.Remove, "AzureRmResourceLock", SupportsShouldProcess = true, DefaultParameterSetName = ResourceLockManagementCmdletBase.LockIdParameterSet), OutputType(typeof(PSObject))]
2424
public class RemoveAzureResourceLockCmdlet : ResourceLockManagementCmdletBase
2525
{
2626
/// <summary>

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Microsoft.Azure.Commands.ResourceManager.Cmdlets.dll-Help.xml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4861,17 +4861,26 @@
48614861
</maml:alertSet>
48624862
<command:examples>
48634863
<command:example>
4864-
<maml:title>-------------------------- RemoveLock1 --------------------------</maml:title>
4864+
<maml:title>-------------------------- Example 1: RemoveLock using ResourceId --------------------------</maml:title>
48654865
<maml:introduction>
4866-
<maml:paragraph>PS C:\&gt;</maml:paragraph>
48674866
</maml:introduction>
48684867
<dev:code>Remove-AzureRmResourceLock -ResourceId /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-SouthCentralUS/providers/Microsoft.ClassicStorage/storageAccounts/mystorageaccount/providers/Microsoft.Authorization/locks/test</dev:code>
48694868
<dev:remarks>
4870-
<maml:para />
4871-
<maml:para />
4872-
<maml:para />
4873-
<maml:para>
4874-
</maml:para>
4869+
</dev:remarks>
4870+
<command:commandLines>
4871+
<command:commandLine>
4872+
<command:commandText>
4873+
<maml:para />
4874+
</command:commandText>
4875+
</command:commandLine>
4876+
</command:commandLines>
4877+
</command:example>
4878+
<command:example>
4879+
<maml:title>-------------------------- Example 2: RemoveLock using LockId --------------------------</maml:title>
4880+
<maml:introduction>
4881+
</maml:introduction>
4882+
<dev:code>Remove-AzureRmResourceLock -LockId /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-SouthCentralUS/providers/Microsoft.ClassicStorage/storageAccounts/mystorageaccount/providers/Microsoft.Authorization/locks/test</dev:code>
4883+
<dev:remarks>
48754884
</dev:remarks>
48764885
<command:commandLines>
48774886
<command:commandLine>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,8 @@ function Test-ResourceLockCRUD
4141
$removed = Remove-AzureRMResourceLock -LockId $expectedSet.LockId -Force
4242
Assert-AreEqual True $removed
4343

44+
$actual = New-AzureRMResourceLock -LockName $rname -LockLevel CanNotDelete -Force -Scope $rg.ResourceId
45+
$removed = Remove-AzureRMResourceLock -ResourceId $actual.ResourceId -Force
46+
Assert-AreEqual True $removed
47+
4448
}

src/ResourceManager/Resources/Commands.Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ResourceLockTests/TestResourceLockCRUDTest.json

Lines changed: 162 additions & 168 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)