Skip to content

Commit 8dedf30

Browse files
unknownunknown
unknown
authored and
unknown
committed
Merge branch 'dev' of https://github.com/huangpf/azure-powershell into dev2
2 parents 39d57bf + 921c3e1 commit 8dedf30

18 files changed

+390
-211
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/AvailabilitySets/NewAzureAvailabilitySetCommand.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using AutoMapper;
1516
using Microsoft.Azure.Commands.Compute.Common;
17+
using Microsoft.Azure.Commands.Compute.Models;
1618
using Microsoft.Azure.Management.Compute;
1719
using Microsoft.Azure.Management.Compute.Models;
1820
using System.Management.Automation;
1921

2022
namespace Microsoft.Azure.Commands.Compute
2123
{
2224
[Cmdlet(VerbsCommon.New, ProfileNouns.AvailabilitySet)]
25+
[OutputType(typeof(PSAvailabilitySet))]
2326
public class NewAzureAvailabilitySetCommand : AvailabilitySetBaseCmdlet
2427
{
2528
[Parameter(
@@ -73,11 +76,12 @@ public override void ExecuteCmdlet()
7376
PlatformFaultDomainCount = this.PlatformFaultDomainCount
7477
};
7578

76-
var op = this.AvailabilitySetClient.CreateOrUpdate(
79+
var result = this.AvailabilitySetClient.CreateOrUpdate(
7780
this.ResourceGroupName,
7881
avSetParams);
7982

80-
WriteObject(op);
83+
var psResult = Mapper.Map<PSAvailabilitySet>(result.AvailabilitySet);
84+
WriteObject(psResult);
8185
}
8286
}
8387
}

src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
<Compile Include="Extension\GetAzureVMExtensionCommand.cs" />
165165
<Compile Include="Images\GetAzureVMImageCommand.cs" />
166166
<Compile Include="Models\HashTableExtensions.cs" />
167+
<Compile Include="Models\PSComputeLongRunningOperation.cs" />
167168
<Compile Include="Models\PSOperation.cs" />
168169
<Compile Include="Extension\VMAccess\GetAzureVMAccessExtension.cs" />
169170
<Compile Include="Extension\VMAccess\RemoveAzureVMAccessExtension.cs" />
@@ -253,6 +254,9 @@
253254
<None Include="Microsoft.Azure.Commands.Compute.dll-Help.psd1">
254255
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
255256
</None>
257+
<None Include="Microsoft.Azure.Commands.Compute.format.generated.ps1xml">
258+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
259+
</None>
256260
<None Include="Microsoft.Azure.Commands.Compute.format.ps1xml">
257261
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
258262
</None>

src/ResourceManager/Compute/Commands.Compute/Common/ComputeAutoMapperProfile.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ protected override void Configure()
7272
Mapper.CreateMap<FROM.VirtualMachine, TO.PSVirtualMachine>();
7373
Mapper.CreateMap<FROM.VirtualMachineSize, TO.PSVirtualMachineSize>();
7474
Mapper.CreateMap<FROM.Usage, TO.PSUsage>();
75+
76+
Mapper.CreateMap<FROM.ComputeLongRunningOperationResponse, TO.PSComputeLongRunningOperation>();
7577
}
7678
}
7779
}

src/ResourceManager/Compute/Commands.Compute/Extension/RemoveAzureVMExtensionCommand.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using AutoMapper;
1516
using Microsoft.Azure.Commands.Compute.Common;
17+
using Microsoft.Azure.Commands.Compute.Models;
1618
using Microsoft.Azure.Management.Compute;
17-
using Microsoft.Azure.Management.Compute.Models;
1819
using System.Management.Automation;
1920

2021
namespace Microsoft.Azure.Commands.Compute
2122
{
2223
[Cmdlet(VerbsCommon.Remove, ProfileNouns.VirtualMachineExtension)]
23-
[OutputType(typeof(ComputeLongRunningOperationResponse))]
24+
[OutputType(typeof(PSComputeLongRunningOperation))]
2425
public class RemoveAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
2526
{
2627
[Parameter(
@@ -61,7 +62,8 @@ public override void ExecuteCmdlet()
6162
|| this.ShouldContinue(Properties.Resources.VirtualMachineExtensionRemovalConfirmation, Properties.Resources.VirtualMachineExtensionRemovalCaption))
6263
{
6364
var op = this.VirtualMachineExtensionClient.Delete(this.ResourceGroupName, this.VMName, this.Name);
64-
WriteObject(op);
65+
var result = Mapper.Map<PSComputeLongRunningOperation>(op);
66+
WriteObject(result);
6567
}
6668
}
6769
}

src/ResourceManager/Compute/Commands.Compute/Extension/SetAzureVMExtensionCommand.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using AutoMapper;
1516
using Microsoft.Azure.Commands.Compute.Common;
17+
using Microsoft.Azure.Commands.Compute.Models;
1618
using Microsoft.Azure.Management.Compute;
1719
using Microsoft.Azure.Management.Compute.Models;
1820
using Newtonsoft.Json;
@@ -25,6 +27,7 @@ namespace Microsoft.Azure.Commands.Compute
2527
VerbsCommon.Set,
2628
ProfileNouns.VirtualMachineExtension,
2729
DefaultParameterSetName = SettingsParamSet)]
30+
[OutputType(typeof(PSComputeLongRunningOperation))]
2831
public class SetAzureVMExtensionCommand : VirtualMachineExtensionBaseCmdlet
2932
{
3033
protected const string SettingStringParamSet = "SettingString";
@@ -124,8 +127,6 @@ public override void ExecuteCmdlet()
124127
{
125128
base.ExecuteCmdlet();
126129

127-
128-
129130
if (this.Settings != null)
130131
{
131132
this.SettingString = JsonConvert.SerializeObject(Settings);
@@ -149,7 +150,8 @@ public override void ExecuteCmdlet()
149150
this.VMName,
150151
parameters);
151152

152-
WriteObject(op);
153+
var result = Mapper.Map<PSComputeLongRunningOperation>(op);
154+
WriteObject(result);
153155
}
154156
}
155157
}

src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ TypesToProcess = @(
6060

6161
# Format files (.ps1xml) to be loaded when importing this module
6262
FormatsToProcess = @(
63-
'.\Microsoft.Azure.Commands.Compute.format.ps1xml'
63+
'.\Microsoft.Azure.Commands.Compute.format.ps1xml',
64+
'.\Microsoft.Azure.Commands.Compute.format.generated.ps1xml'
6465
)
6566

6667
# Modules to import as nested modules of the module specified in ModuleToProcess
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
//
4+
// Copyright (c) Microsoft and contributors. All rights reserved.
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
//
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
19+
// Warning: This code was generated by a tool.
20+
//
21+
// Changes to this file may cause incorrect behavior and will be lost if the
22+
// code is regenerated.
23+
-->
24+
<Configuration>
25+
<ViewDefinitions>
26+
<View>
27+
<Name>Microsoft.Azure.Commands.Compute.Models.PSAvailabilitySet</Name>
28+
<ViewSelectedBy>
29+
<TypeName>Microsoft.Azure.Commands.Compute.Models.PSAvailabilitySet</TypeName>
30+
</ViewSelectedBy>
31+
<ListControl>
32+
<ListEntries>
33+
<ListEntry>
34+
<ListItems>
35+
<ListItem>
36+
<Label>ResourceGroupName</Label>
37+
<PropertyName>ResourceGroupName</PropertyName>
38+
</ListItem>
39+
<ListItem>
40+
<Label>Id</Label>
41+
<PropertyName>Id</PropertyName>
42+
</ListItem>
43+
<ListItem>
44+
<Label>Name</Label>
45+
<PropertyName>Name</PropertyName>
46+
</ListItem>
47+
<ListItem>
48+
<Label>Type</Label>
49+
<PropertyName>Type</PropertyName>
50+
</ListItem>
51+
<ListItem>
52+
<Label>Location</Label>
53+
<PropertyName>Location</PropertyName>
54+
</ListItem>
55+
<ListItem>
56+
<Label>Tags</Label>
57+
<PropertyName>TagsText</PropertyName>
58+
</ListItem>
59+
<ListItem>
60+
<Label>PlatformFaultDomainCount</Label>
61+
<PropertyName>PlatformFaultDomainCount</PropertyName>
62+
</ListItem>
63+
<ListItem>
64+
<Label>PlatformUpdateDomainCount</Label>
65+
<PropertyName>PlatformUpdateDomainCount</PropertyName>
66+
</ListItem>
67+
<ListItem>
68+
<Label>Statuses</Label>
69+
<PropertyName>StatusesText</PropertyName>
70+
</ListItem>
71+
<ListItem>
72+
<Label>VirtualMachinesReferences</Label>
73+
<PropertyName>VirtualMachinesReferencesText</PropertyName>
74+
</ListItem>
75+
</ListItems>
76+
</ListEntry>
77+
</ListEntries>
78+
</ListControl>
79+
</View>
80+
<View>
81+
<Name>Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineSize</Name>
82+
<ViewSelectedBy>
83+
<TypeName>Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineSize</TypeName>
84+
</ViewSelectedBy>
85+
<ListControl>
86+
<ListEntries>
87+
<ListEntry>
88+
<ListItems>
89+
<ListItem>
90+
<Label>MaxDataDiskCount</Label>
91+
<PropertyName>MaxDataDiskCount</PropertyName>
92+
</ListItem>
93+
<ListItem>
94+
<Label>MemoryInMB</Label>
95+
<PropertyName>MemoryInMB</PropertyName>
96+
</ListItem>
97+
<ListItem>
98+
<Label>Name</Label>
99+
<PropertyName>Name</PropertyName>
100+
</ListItem>
101+
<ListItem>
102+
<Label>NumberOfCores</Label>
103+
<PropertyName>NumberOfCores</PropertyName>
104+
</ListItem>
105+
<ListItem>
106+
<Label>OSDiskSizeInMB</Label>
107+
<PropertyName>OSDiskSizeInMB</PropertyName>
108+
</ListItem>
109+
<ListItem>
110+
<Label>ResourceDiskSizeInMB</Label>
111+
<PropertyName>ResourceDiskSizeInMB</PropertyName>
112+
</ListItem>
113+
</ListItems>
114+
</ListEntry>
115+
</ListEntries>
116+
</ListControl>
117+
</View>
118+
<View>
119+
<Name>Microsoft.Azure.Commands.Compute.Models.PSUsage</Name>
120+
<ViewSelectedBy>
121+
<TypeName>Microsoft.Azure.Commands.Compute.Models.PSUsage</TypeName>
122+
</ViewSelectedBy>
123+
<ListControl>
124+
<ListEntries>
125+
<ListEntry>
126+
<ListItems>
127+
<ListItem>
128+
<Label>CurrentValue</Label>
129+
<PropertyName>CurrentValue</PropertyName>
130+
</ListItem>
131+
<ListItem>
132+
<Label>Limit</Label>
133+
<PropertyName>Limit</PropertyName>
134+
</ListItem>
135+
<ListItem>
136+
<Label>Name</Label>
137+
<PropertyName>NameText</PropertyName>
138+
</ListItem>
139+
<ListItem>
140+
<Label>Unit</Label>
141+
<PropertyName>UnitText</PropertyName>
142+
</ListItem>
143+
</ListItems>
144+
</ListEntry>
145+
</ListEntries>
146+
</ListControl>
147+
</View>
148+
<View>
149+
<Name>Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine</Name>
150+
<ViewSelectedBy>
151+
<TypeName>Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine</TypeName>
152+
</ViewSelectedBy>
153+
<ListControl>
154+
<ListEntries>
155+
<ListEntry>
156+
<ListItems>
157+
<ListItem>
158+
<Label>ResourceGroupName</Label>
159+
<PropertyName>ResourceGroupName</PropertyName>
160+
</ListItem>
161+
<ListItem>
162+
<Label>Id</Label>
163+
<PropertyName>Id</PropertyName>
164+
</ListItem>
165+
<ListItem>
166+
<Label>Name</Label>
167+
<PropertyName>Name</PropertyName>
168+
</ListItem>
169+
<ListItem>
170+
<Label>Type</Label>
171+
<PropertyName>Type</PropertyName>
172+
</ListItem>
173+
<ListItem>
174+
<Label>Location</Label>
175+
<PropertyName>Location</PropertyName>
176+
</ListItem>
177+
<ListItem>
178+
<Label>Tags</Label>
179+
<PropertyName>TagsText</PropertyName>
180+
</ListItem>
181+
<ListItem>
182+
<Label>AvailabilitySetReference</Label>
183+
<PropertyName>AvailabilitySetReferenceText</PropertyName>
184+
</ListItem>
185+
<ListItem>
186+
<Label>Extensions</Label>
187+
<PropertyName>ExtensionsText</PropertyName>
188+
</ListItem>
189+
<ListItem>
190+
<Label>HardwareProfile</Label>
191+
<PropertyName>HardwareProfileText</PropertyName>
192+
</ListItem>
193+
<ListItem>
194+
<Label>InstanceView</Label>
195+
<PropertyName>InstanceViewText</PropertyName>
196+
</ListItem>
197+
<ListItem>
198+
<Label>NetworkProfile</Label>
199+
<PropertyName>NetworkProfileText</PropertyName>
200+
</ListItem>
201+
<ListItem>
202+
<Label>OSProfile</Label>
203+
<PropertyName>OSProfileText</PropertyName>
204+
</ListItem>
205+
<ListItem>
206+
<Label>Plan</Label>
207+
<PropertyName>PlanText</PropertyName>
208+
</ListItem>
209+
<ListItem>
210+
<Label>ProvisioningState</Label>
211+
<PropertyName>ProvisioningState</PropertyName>
212+
</ListItem>
213+
<ListItem>
214+
<Label>StorageProfile</Label>
215+
<PropertyName>StorageProfileText</PropertyName>
216+
</ListItem>
217+
</ListItems>
218+
</ListEntry>
219+
</ListEntries>
220+
</ListControl>
221+
</View>
222+
</ViewDefinitions>
223+
</Configuration>

0 commit comments

Comments
 (0)