Skip to content

Commit 6609d5a

Browse files
committed
Remove redundant "-All" flag in Get-AzureVM
1 parent d93693d commit 6609d5a

File tree

2 files changed

+13
-28
lines changed

2 files changed

+13
-28
lines changed

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function Test-VirtualMachineList
189189

190190
try
191191
{
192-
$s1 = Get-AzureVM -All;
192+
$s1 = Get-AzureVM;
193193
$s2 = Get-AzureVM;
194194

195195
if ($s2 -ne $null)

src/ResourceManager/Compute/Commands.Compute/VirtualMachine/Operation/GetAzureVMCommand.cs

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,58 +27,44 @@ namespace Microsoft.Azure.Commands.Compute
2727
[OutputType(typeof(PSVirtualMachine), typeof(PSVirtualMachineInstanceView))]
2828
public class GetAzureVMCommand : VirtualMachineBaseCmdlet
2929
{
30-
protected const string GetVirtualMachineParamSet = "GetVirtualMachineParamSet";
31-
protected const string ListVirtualMachineParamSet = "ListVirtualMachineParamSet";
30+
protected const string GetVirtualMachineInResourceGroupParamSet = "GetVirtualMachineInResourceGroupParamSet";
31+
protected const string ListVirtualMachineInResourceGroupParamSet = "ListVirtualMachineInResourceGroupParamSet";
3232
protected const string ListAllVirtualMachinesParamSet = "ListAllVirtualMachinesParamSet";
33-
protected const string ListNextVirtualMachinesParamSet = "ListNextVirtualMachinesParamSet";
33+
protected const string ListNextLinkVirtualMachinesParamSet = "ListNextLinkVirtualMachinesParamSet";
3434

3535
[Parameter(
3636
Mandatory = true,
3737
Position = 0,
38-
ParameterSetName = ListVirtualMachineParamSet,
39-
ValueFromPipelineByPropertyName = true,
40-
HelpMessage = "The resource group name.")]
38+
ParameterSetName = ListVirtualMachineInResourceGroupParamSet,
39+
ValueFromPipelineByPropertyName = true)]
4140
[Parameter(
4241
Mandatory = true,
4342
Position = 0,
44-
ParameterSetName = GetVirtualMachineParamSet,
45-
ValueFromPipelineByPropertyName = true,
46-
HelpMessage = "The resource group name.")]
43+
ParameterSetName = GetVirtualMachineInResourceGroupParamSet,
44+
ValueFromPipelineByPropertyName = true)]
4745
[ValidateNotNullOrEmpty]
4846
public string ResourceGroupName { get; set; }
4947

5048
[Alias("ResourceName", "VMName")]
5149
[Parameter(
5250
Mandatory = true,
5351
Position = 1,
54-
ParameterSetName = GetVirtualMachineParamSet,
55-
ValueFromPipelineByPropertyName = true,
56-
HelpMessage = "The resource name.")]
52+
ParameterSetName = GetVirtualMachineInResourceGroupParamSet,
53+
ValueFromPipelineByPropertyName = true)]
5754
[ValidateNotNullOrEmpty]
5855
public string Name { get; set; }
5956

6057
[Parameter(
6158
Position = 2,
62-
ParameterSetName = GetVirtualMachineParamSet,
63-
ValueFromPipelineByPropertyName = true,
64-
HelpMessage = "To show the status.")]
59+
ParameterSetName = GetVirtualMachineInResourceGroupParamSet)]
6560
[ValidateNotNullOrEmpty]
6661
public SwitchParameter Status { get; set; }
6762

68-
[Parameter(
69-
Position = 1,
70-
ParameterSetName = ListAllVirtualMachinesParamSet,
71-
ValueFromPipelineByPropertyName = true,
72-
HelpMessage = "To list all virtual machines.")]
73-
[ValidateNotNullOrEmpty]
74-
public SwitchParameter All { get; set; }
75-
7663
[Parameter(
7764
Mandatory = true,
7865
Position = 1,
79-
ParameterSetName = ListNextVirtualMachinesParamSet,
80-
ValueFromPipelineByPropertyName = true,
81-
HelpMessage = "The link to the next page of virtual machines.")]
66+
ParameterSetName = ListNextLinkVirtualMachinesParamSet,
67+
ValueFromPipelineByPropertyName = true)]
8268
[ValidateNotNullOrEmpty]
8369
public Uri NextLink { get; set; }
8470

@@ -125,7 +111,6 @@ public override void ExecuteCmdlet()
125111
psResultList.Add(psItem);
126112
}
127113

128-
129114
WriteObject(psResultList, true);
130115
}
131116
}

0 commit comments

Comments
 (0)