Skip to content

Commit faef27a

Browse files
committed
Fix the output of New-AzureRMVM and Update-AzureRMVM
1 parent 64bfa31 commit faef27a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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

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

15+
using AutoMapper;
1516
using Microsoft.Azure.Commands.Compute.Common;
1617
using Microsoft.Azure.Commands.Compute.Models;
17-
using Microsoft.Azure.Commands.Tags.Model;
1818
using Microsoft.Azure.Management.Compute;
1919
using Microsoft.Azure.Management.Compute.Models;
2020
using System.Collections;
@@ -23,6 +23,7 @@
2323
namespace Microsoft.Azure.Commands.Compute
2424
{
2525
[Cmdlet(VerbsCommon.New, ProfileNouns.VirtualMachine)]
26+
[OutputType(typeof(PSComputeLongRunningOperation))]
2627
public class NewAzureVMCommand : VirtualMachineBaseCmdlet
2728
{
2829
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true)]
@@ -61,7 +62,8 @@ protected override void ProcessRecord()
6162
};
6263

6364
var op = this.VirtualMachineClient.CreateOrUpdate(this.ResourceGroupName, parameters);
64-
WriteObject(op);
65+
var result = Mapper.Map<PSComputeLongRunningOperation>(op);
66+
WriteObject(result);
6567
});
6668
}
6769
}

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

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

15-
15+
using AutoMapper;
1616
using Microsoft.Azure.Commands.Compute.Common;
1717
using Microsoft.Azure.Commands.Compute.Models;
1818
using Microsoft.Azure.Management.Compute;
@@ -22,7 +22,8 @@
2222

2323
namespace Microsoft.Azure.Commands.Compute
2424
{
25-
[Cmdlet(VerbsData.Update, ProfileNouns.VirtualMachine, DefaultParameterSetName = ResourceGroupNameParameterSet)]
25+
[Cmdlet(VerbsData.Update, ProfileNouns.VirtualMachine, DefaultParameterSetName = ResourceGroupNameParameterSet)]
26+
[OutputType(typeof(PSComputeLongRunningOperation))]
2627
public class UpdateAzureVMCommand : VirtualMachineActionBaseCmdlet
2728
{
2829
[Alias("VMProfile")]
@@ -53,7 +54,8 @@ protected override void ProcessRecord()
5354
};
5455

5556
var op = this.VirtualMachineClient.CreateOrUpdate(this.ResourceGroupName, parameters);
56-
WriteObject(op);
57+
var result = Mapper.Map<PSComputeLongRunningOperation>(op);
58+
WriteObject(result);
5759
});
5860
}
5961
}

0 commit comments

Comments
 (0)