Skip to content

Commit 3183dbd

Browse files
{AzureCompute} Include the ProvisioningState value in Get-AzVMRunCommand output (#21490)
* {AzureCompute} Include the ProvisioningState value in Get-AzVMRunCommand output fixes #21473 ProvisioningState is empty in Get-AzVMRunCommand output. GET VM Run command REST API does return ProvisioningState correctly. See the response returned: ``` Name : navbaRunCommand Location : SouthIndia Id : /subscriptions/XXXXXXX/resourceGroups/navbavmdel/providers/Microsoft.C ompute/virtualMachines/navbavmdel/runCommands/navbaRunCommand Type : Microsoft.Compute/virtualMachines/runCommands Tags : {[Reason, Repro], [CreatedDate, 4/11/2023 4:07:00 AM], [CreatedBy, NA], [OwningTeam, NA]} Source : Microsoft.Azure.Management.Compute.Models.VirtualMachineRunCommandScriptSource Parameters : {} ProtectedParameters : {} AsyncExecution : False RunAsUser : RunAsPassword : TimeoutInSeconds : 0 OutputBlobUri : ErrorBlobUri : ProvisioningState : InstanceView : ``` This PR includes the fix for this and includes the ProvisioningState value in Get-AzVMRunCommand output * Update PSVirtualMachineRunCommand.cs * Update ChangeLog.md * Update ChangeLog.md --------- Co-authored-by: Yunchi Wang <[email protected]>
1 parent 402e27a commit 3183dbd

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/Compute/Compute/ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
## Upcoming Release
2323
* Added a breaking change warning to the `Get-AzVM` cmdlet to show that the `NextLink` parameter and parameter set will be removed in June 2023. The parameter has been non-functional for a long time.
2424
* Updated the breaking change warning in `New-AzVM` and `New-AzVmss` regarding using the new versioned image aliases to indicate that certain aliases will be removed next breaking change release.
25+
* Updated the `Get-AzVMRunCommand` to include the `ProvisioningState` value. Fix [#21473]
2526
* Updated Azure.Core to 1.30.0.
2627

27-
2828
## Version 5.7.0
2929
* Addressed bug in `Remove-AzVmss` to throw error when `-InstanceId` is null. [#21162]
3030
* Added `-CustomData`, `-AdminPassword`, and `-ExactVersion` parameters to `Invoke-AzVMReimage`.

src/Compute/Compute/Manual/PSVirtualMachineRunCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class PSVirtualMachineRunCommand
2222
public int? TimeoutInSeconds { get; set; }
2323
public string OutputBlobUri { get; set; }
2424
public string ErrorBlobUri { get; set; }
25-
public string ProvisioningState { get; }
25+
public string ProvisioningState { get; set; }
2626
public VirtualMachineRunCommandInstanceView InstanceView { get; set; }
2727
}
28-
}
28+
}

src/Compute/Compute/VirtualMachine/RunCommand/GetAzVmRunCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public override void ExecuteCmdlet()
6969
VirtualMachineRunCommand vmRc = VirtualMachineRunCommandsClient.GetByVirtualMachine(this.ResourceGroupName, this.VMName, this.RunCommandName, this.Expand);
7070
PSVirtualMachineRunCommand psObject = new PSVirtualMachineRunCommand();
7171
ComputeAutomationAutoMapperProfile.Mapper.Map<VirtualMachineRunCommand, PSVirtualMachineRunCommand>(vmRc, psObject);
72+
psObject.ProvisioningState = vmRc.ProvisioningState;
7273
WriteObject(psObject);
7374
}
7475
else

0 commit comments

Comments
 (0)