Skip to content

Commit c6d77ae

Browse files
committed
Merge pull request #514 from Azure/dev
HPF PR: dev <- Azure:dev
2 parents 887e17d + 40ff809 commit c6d77ae

File tree

6 files changed

+216
-176
lines changed

6 files changed

+216
-176
lines changed

src/Common/Commands.Common.Authentication/Commands.Common.Authentication.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
<Compile Include="Interfaces\IClientFactory.cs" />
150150
<Compile Include="Interfaces\IDataStore.cs" />
151151
<Compile Include="Interfaces\IProfileSerializer.cs" />
152+
<Compile Include="LegacySupport.cs" />
152153
<Compile Include="Models\AzureAccount.cs" />
153154
<Compile Include="Models\AzureAccount.Methods.cs" />
154155
<Compile Include="Models\AzureContext.cs" />
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.Common.Authentication;
16+
17+
namespace Microsoft.Azure.Common.Authentication
18+
{
19+
/// <summary>
20+
/// Provide backward compatibility for setting User Agent values
21+
/// </summary>
22+
public static class AzureSession
23+
{
24+
/// <summary>
25+
/// The ClientFactory used to produce management clients in this session
26+
/// </summary>
27+
public static IClientFactory ClientFactory
28+
{
29+
get { return Commands.Common.Authentication.AzureSession.ClientFactory; }
30+
}
31+
}
32+
}

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)