Skip to content

Commit bdc63c3

Browse files
committed
Updated error messages; Removed scope-less aliases; changed -Purge to -PurgeResources in Remove-Az* cmdlets
1 parent ea93530 commit bdc63c3

File tree

7 files changed

+17
-21
lines changed

7 files changed

+17
-21
lines changed

src/Resources/ResourceManager/Implementation/DeploymentStacks/GetAzDeploymentStack.cs renamed to src/Resources/ResourceManager/Implementation/DeploymentStacks/GetAzSubscriptionDeploymentStack.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2121
using System.Management.Automation;
2222
using System.Text;
2323

24-
[Cmdlet("Get", Common.AzureRMConstants.AzureRMPrefix + "DeploymentStack",
25-
DefaultParameterSetName = GetAzDeploymentStack.ListParameterSetname), OutputType(typeof(PSDeploymentStack))]
26-
[Alias("Get-AzSubscriptionDeploymentStack")]
27-
public class GetAzDeploymentStack : DeploymentStacksCmdletBase
24+
[Cmdlet("Get", Common.AzureRMConstants.AzureRMPrefix + "SubscriptionDeploymentStack",
25+
DefaultParameterSetName = GetAzSubscriptionDeploymentStack.ListParameterSetname), OutputType(typeof(PSDeploymentStack))]
26+
public class GetAzSubscriptionDeploymentStack : DeploymentStacksCmdletBase
2827
{
2928
#region Cmdlet Parameters and Parameter Set Definitions
3029

src/Resources/ResourceManager/Implementation/DeploymentStacks/GetAzDeploymentStackSnapshot.cs renamed to src/Resources/ResourceManager/Implementation/DeploymentStacks/GetAzSubscriptionDeploymentStackSnapshot.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
2121
using System.Management.Automation;
2222
using System.Text;
2323

24-
[Cmdlet("Get", Common.AzureRMConstants.AzureRMPrefix + "DeploymentStackSnapshot",
25-
DefaultParameterSetName = GetAzDeploymentStackSnapshot.ListParameterSetname), OutputType(typeof(PSDeploymentStackSnapshot))]
26-
[Alias("Get-AzSubscriptionDeploymentStackSnapshot")]
27-
public class GetAzDeploymentStackSnapshot : DeploymentStacksCmdletBase
24+
[Cmdlet("Get", Common.AzureRMConstants.AzureRMPrefix + "SubscriptionDeploymentStackSnapshot",
25+
DefaultParameterSetName = GetAzSubscriptionDeploymentStackSnapshot.ListParameterSetname), OutputType(typeof(PSDeploymentStackSnapshot))]
26+
public class GetAzSubscriptionDeploymentStackSnapshot : DeploymentStacksCmdletBase
2827
{
2928
#region Cmdlet Parameters and Parameter Set Definitions
3029

src/Resources/ResourceManager/Implementation/DeploymentStacks/RemoveAzResourceGroupDeploymentStack.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class RemoveAzResourceGroupDeploymentStack : DeploymentStacksCmdletBase
5252

5353
[Parameter(Mandatory = false,
5454
HelpMessage = "Delete all resources along with the stack.")]
55-
public SwitchParameter Purge { get; set; }
55+
public SwitchParameter PurgeResources { get; set; }
5656

5757
#endregion
5858

@@ -71,7 +71,7 @@ public override void ExecuteCmdlet()
7171

7272
string confirmationMessage = $"Are you sure you want to remove DeploymentStack '{Name}'";
7373

74-
string deleteBehavior = Purge.IsPresent ? "all" : null;
74+
string deleteBehavior = PurgeResources.IsPresent ? "all" : null;
7575

7676
ConfirmAction(
7777
Force.IsPresent,

src/Resources/ResourceManager/Implementation/DeploymentStacks/RemoveAzSubscriptionDeploymentStack.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class RemoveAzSubscriptionDeploymentStack : DeploymentStacksCmdletBase
4747

4848
[Parameter(Mandatory = false,
4949
HelpMessage = "Delete all resources along with the stack.")]
50-
public SwitchParameter Purge { get; set; }
50+
public SwitchParameter PurgeResources { get; set; }
5151

5252
#endregion
5353

@@ -61,7 +61,7 @@ public override void ExecuteCmdlet()
6161

6262
string confirmationMessage = $"Are you sure you want to remove DeploymentStack '{Name}'";
6363

64-
string deleteBehavior = Purge.IsPresent ? "all" : null;
64+
string deleteBehavior = PurgeResources.IsPresent ? "all" : null;
6565

6666
ConfirmAction(
6767
Force.IsPresent,

src/Resources/ResourceManager/Implementation/DeploymentStacks/SetAzSubscriptionDeploymentStack.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public override void ExecuteCmdlet()
209209
throwIfNotExists: false) == null)
210210
{
211211
string confirmationMessage =
212-
$"The DeploymentStack '{Name}' you're trying to modify does not exist in the current subscription. Do you want to create a new stack?";
212+
$"The DeploymentStack '{Name}' you're trying to modify does not exist in the current subscription scope. Do you want to create a new stack?";
213213

214214
ConfirmAction(
215215
Force.IsPresent,

src/Resources/ResourceManager/SdkClient/DeploymentStacksSdkClient.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public PSDeploymentStack GetSubscriptionDeploymentStack(string stackName, bool t
214214
return null;
215215
else
216216
throw new PSArgumentException(
217-
$"DeploymentStack '{stackName}' not found in current subscription."
217+
$"DeploymentStack '{stackName}' not found in current subscription scope."
218218
);
219219
}
220220
else
@@ -308,7 +308,7 @@ public PSDeploymentStackSnapshot GetSubscriptionDeploymentStackSnapshot(string s
308308
return null;
309309
else
310310
throw new PSArgumentException(
311-
$"DeploymentStackSnapshot '{snapshotName}' of DeploymentStack '{stackName}' not found in current subscription."
311+
$"DeploymentStackSnapshot '{snapshotName}' of DeploymentStack '{stackName}' not found in current subscription scope."
312312
);
313313
}
314314
else
@@ -414,7 +414,7 @@ internal void DeleteSubscriptionDeploymentStackSnapshot(string stackname, string
414414
if (deleteResponse.Response.StatusCode == System.Net.HttpStatusCode.NoContent)
415415
{
416416
throw new PSArgumentException(
417-
$"DeploymentStack snapshot '{snapshotName}' of the DeploymentStack '{stackname}' not found."
417+
$"DeploymentStack snapshot '{snapshotName}' of the DeploymentStack '{stackname}' not found in the current subscription scope."
418418
);
419419
}
420420

@@ -448,7 +448,7 @@ internal void DeleteSubscriptionDeploymentStack(string name, string deleteBehavi
448448
if (deleteResponse.Response.StatusCode == System.Net.HttpStatusCode.NoContent)
449449
{
450450
throw new PSArgumentException(
451-
$"DeploymentStack '{name}' not found."
451+
$"DeploymentStack '{name}' not found in the curent subscription scope."
452452
);
453453
}
454454

src/Resources/Resources/Az.Resources.psd1

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ CmdletsToExport = 'Get-AzProviderOperation', 'Remove-AzRoleAssignment',
158158
'New-AzSubscriptionDeploymentStack', 'Remove-AzResourceGroupDeploymentStack',
159159
'Remove-AzResourceGroupDeploymentStackSnapshot', 'Remove-AzSubscriptionDeploymentStack',
160160
'Remove-AzSubscriptionDeploymentStackSnapshot', 'Set-AzResourceGroupDeploymentStack',
161-
'Set-AzSubscriptionDeploymentStack', 'Get-AzDeploymentStack', 'Get-AzDeploymentStackSnapshot'
161+
'Set-AzSubscriptionDeploymentStack', 'Get-AzSubscriptionDeploymentStack', 'Get-AzSubscriptionDeploymentStackSnapshot'
162162

163163
# Variables to export from this module
164164
# VariablesToExport = @()
@@ -174,9 +174,7 @@ AliasesToExport = 'Get-AzResourceProviderAction',
174174
'Stop-AzSubscriptionDeployment',
175175
'Save-AzSubscriptionDeploymentTemplate',
176176
'Get-AzSubscriptionDeploymentOperation',
177-
'Get-AzSubscriptionDeploymentWhatIfResult',
178-
'Get-AzSubscriptionDeploymentStack',
179-
'Get-AzSubscriptionDeploymentStackSnapshot'
177+
'Get-AzSubscriptionDeploymentWhatIfResult'
180178

181179
# DSC resources to export from this module
182180
# DscResourcesToExport = @()

0 commit comments

Comments
 (0)