@@ -27,58 +27,44 @@ namespace Microsoft.Azure.Commands.Compute
27
27
[ OutputType ( typeof ( PSVirtualMachine ) , typeof ( PSVirtualMachineInstanceView ) ) ]
28
28
public class GetAzureVMCommand : VirtualMachineBaseCmdlet
29
29
{
30
- protected const string GetVirtualMachineParamSet = "GetVirtualMachineParamSet " ;
31
- protected const string ListVirtualMachineParamSet = "ListVirtualMachineParamSet " ;
30
+ protected const string GetVirtualMachineInResourceGroupParamSet = "GetVirtualMachineInResourceGroupParamSet " ;
31
+ protected const string ListVirtualMachineInResourceGroupParamSet = "ListVirtualMachineInResourceGroupParamSet " ;
32
32
protected const string ListAllVirtualMachinesParamSet = "ListAllVirtualMachinesParamSet" ;
33
- protected const string ListNextVirtualMachinesParamSet = "ListNextVirtualMachinesParamSet " ;
33
+ protected const string ListNextLinkVirtualMachinesParamSet = "ListNextLinkVirtualMachinesParamSet " ;
34
34
35
35
[ Parameter (
36
36
Mandatory = true ,
37
37
Position = 0 ,
38
- ParameterSetName = ListVirtualMachineParamSet ,
39
- ValueFromPipelineByPropertyName = true ,
40
- HelpMessage = "The resource group name." ) ]
38
+ ParameterSetName = ListVirtualMachineInResourceGroupParamSet ,
39
+ ValueFromPipelineByPropertyName = true ) ]
41
40
[ Parameter (
42
41
Mandatory = true ,
43
42
Position = 0 ,
44
- ParameterSetName = GetVirtualMachineParamSet ,
45
- ValueFromPipelineByPropertyName = true ,
46
- HelpMessage = "The resource group name." ) ]
43
+ ParameterSetName = GetVirtualMachineInResourceGroupParamSet ,
44
+ ValueFromPipelineByPropertyName = true ) ]
47
45
[ ValidateNotNullOrEmpty ]
48
46
public string ResourceGroupName { get ; set ; }
49
47
50
48
[ Alias ( "ResourceName" , "VMName" ) ]
51
49
[ Parameter (
52
50
Mandatory = true ,
53
51
Position = 1 ,
54
- ParameterSetName = GetVirtualMachineParamSet ,
55
- ValueFromPipelineByPropertyName = true ,
56
- HelpMessage = "The resource name." ) ]
52
+ ParameterSetName = GetVirtualMachineInResourceGroupParamSet ,
53
+ ValueFromPipelineByPropertyName = true ) ]
57
54
[ ValidateNotNullOrEmpty ]
58
55
public string Name { get ; set ; }
59
56
60
57
[ Parameter (
61
58
Position = 2 ,
62
- ParameterSetName = GetVirtualMachineParamSet ,
63
- ValueFromPipelineByPropertyName = true ,
64
- HelpMessage = "To show the status." ) ]
59
+ ParameterSetName = GetVirtualMachineInResourceGroupParamSet ) ]
65
60
[ ValidateNotNullOrEmpty ]
66
61
public SwitchParameter Status { get ; set ; }
67
62
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
-
76
63
[ Parameter (
77
64
Mandatory = true ,
78
65
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 ) ]
82
68
[ ValidateNotNullOrEmpty ]
83
69
public Uri NextLink { get ; set ; }
84
70
@@ -125,7 +111,6 @@ public override void ExecuteCmdlet()
125
111
psResultList . Add ( psItem ) ;
126
112
}
127
113
128
-
129
114
WriteObject ( psResultList , true ) ;
130
115
}
131
116
}
0 commit comments