You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceLockCmdlet.cs
[Parameter(Mandatory=false,HelpMessage="When specified returns all locks at or above the specified scope, otherwise returns all locks at, above or below the scope.")]
34
-
[ValidateNotNullOrEmpty]
35
-
publicSwitchParameterAtScope{get;set;}
36
-
37
-
38
29
/// <summary>
39
30
/// Gets or sets the extension resource name parameter.
40
31
/// </summary>
41
32
[Alias("ExtensionResourceName")]
42
-
[Parameter(Mandatory=false,ValueFromPipelineByPropertyName=true,HelpMessage="The name of the lock.")]
33
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.ResourceGroupLevelLock,Mandatory=false,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
34
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock,Mandatory=false,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
35
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.ScopeLevelLock,Mandatory=false,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
36
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.SubscriptionLevelLock,Mandatory=false,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
37
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock,Mandatory=false,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
38
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.TenantResourceLevelLock,Mandatory=false,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
43
39
[ValidateNotNullOrEmpty]
44
40
publicstringLockName{get;set;}
45
41
46
42
/// <summary>
47
-
/// Gets the resource Id from the supplied PowerShell parameters.
[Parameter(Mandatory=false,HelpMessage="When specified returns all locks at or above the specified scope, otherwise returns all locks at, above or below the scope.")]
Copy file name to clipboardExpand all lines: src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceLockCmdlet.cs
/// Gets or sets the extension resource name parameter.
30
+
/// </summary>
31
+
[Alias("ExtensionResourceName")]
32
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.ResourceGroupLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
33
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
34
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.ScopeLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
35
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.SubscriptionLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
36
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
37
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.TenantResourceLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
38
+
[ValidateNotNullOrEmpty]
39
+
publicstringLockName{get;set;}
40
+
30
41
/// <summary>
31
42
/// Gets or sets the extension resource name parameter.
32
43
/// </summary>
@@ -49,42 +60,13 @@ public class NewAzureResourceLockCmdlet : ResourceLockManagementCmdletBase
49
60
[Parameter(Mandatory=false,HelpMessage="Do not ask for confirmation.")]
50
61
publicSwitchParameterForce{get;set;}
51
62
52
-
/// <summary>
53
-
/// Gets or sets the extension resource name parameter.
54
-
/// </summary>
55
-
[Alias("ExtensionResourceName")]
56
-
[Parameter(Mandatory=true,ValueFromPipelineByPropertyName=true,HelpMessage="The name of the lock.")]
57
-
[ValidateNotNullOrEmpty]
58
-
publicstringLockName{get;set;}
59
-
60
-
/// <summary>
61
-
/// Gets the resource Id from the supplied PowerShell parameters.
Copy file name to clipboardExpand all lines: src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/RemoveAzureResourceLockCmdlet.cs
/// Gets or sets the extension resource name parameter.
28
+
/// </summary>
29
+
[Alias("ExtensionResourceName")]
30
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.ResourceGroupLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
31
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
32
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.ScopeLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
33
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.SubscriptionLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
34
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
35
+
[Parameter(ParameterSetName=ResourceLockManagementCmdletBase.TenantResourceLevelLock,Mandatory=true,ValueFromPipelineByPropertyName=false,HelpMessage="The name of the lock.")]
36
+
[ValidateNotNullOrEmpty]
37
+
publicstringLockName{get;set;}
38
+
39
+
/// <summary>
40
+
/// Gets or sets the force parameter.
41
+
/// </summary>
42
+
[Parameter(Mandatory=false,HelpMessage="Do not ask for confirmation.")]
43
+
publicSwitchParameterForce{get;set;}
44
+
45
+
/// <summary>
46
+
/// Executes the cmdlet.
47
+
/// </summary>
48
+
protectedoverridevoidOnProcessRecord()
49
+
{
50
+
base.OnProcessRecord();
51
+
varresourceId=this.GetResourceId(this.LockName);
52
+
this.ConfirmAction(
53
+
this.Force,
54
+
string.Format("Are you sure you want to delete the following lock: {0}",resourceId),
0 commit comments