Get-AzVMRunCommand cmdlet output fields not displayed (other than Name and Location)
Description
Issue: Output of Get-AzVMRunCommand does not display any other fields apart from Name and Location, which are not useful (because they are input itself).
ASK: mentioned at the bottom of description
PS C:> Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivW0 -RunCommandName RunPowerShellScript14
Location Name
eastus2 RunPowerShellScript14
PS C:> Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivW0 -RunCommandName RunPowerShellScript14 -Expand InstanceView
Location Name
eastus2 RunPowerShellScript14
When I use " | Format-List", all the output fields are displayed. PS C:> Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivW0 -RunCommandName RunPowerShellScript14 -Expand InstanceView | Format-List
AsyncExecution : False ErrorBlobUri : https://vivst.blob.core.windows.net/vivcontainer/error.txt Id : /subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/VivRG0/providers/Microsoft.Compute/virtualMachines/VivW0/runCommands/RunPowerShellScript14 InstanceViewEndTime : 6/8/2022 8:37:21 PM InstanceViewError : 'st' is not recognized as an internal or external command, operable program or batch file. 'se' is not recognized as an internal or external command, operable program or batch file. 'spr' is not recognized as an internal or external command, operable program or batch file. 'sv' is not recognized as an internal or external command, operable program or batch file. 'sr' is not recognized as an internal or external command, operable program or batch file. 'sig' is not recognized as an internal or external command, operable program or batch file. 'st' is not recognized as an internal or external command, operable program or batch file. 'se' is not recognized as an internal or external command, operable program or batch file. 'spr' is not recognized as an internal or external command, operable program or batch file. 'sv' is not recognized as an internal or external command, operable program or batch file. 'sr' is not recognized as an internal or external command, operable program or batch file. 'sig' is not recognized as an internal or external command, operable program or batch file. InstanceViewExecutionMessage : InstanceViewExecutionState : Failed InstanceViewExitCode : 1 InstanceViewOutput : Directory: C:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 6/8/2022 8:37 PM 0 Temp0608_14.txt
InstanceViewStartTime : 6/8/2022 8:37:21 PM InstanceViewStatuses : Location : eastus2 Name : RunPowerShellScript14 OutputBlobUri : https://vivst.blob.core.windows.net/vivcontainer/output.txt Parameter : ProtectedParameter : ProvisioningState : Succeeded RunAsPassword : RunAsUser : SourceCommandId : SourceScript : New-Item -Path C:\ -Name Temp0608_14.txt -ItemType file SourceScriptUri : Tag : Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.ResourceTags TimeoutInSecond : 0 Type : Microsoft.Compute/virtualMachines/runCommands
ASK: We can't expect users to know and use "Format-List" to access output when they use cmdlet programmatically. By default, when the Get-AzVMRunCommand is executed, could you change format such that all output fields are displayed ?
Issue script & Debug output
NA
Environment data
NA
Module versions
NA
Error output
No response
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @avirishuv.
Issue Details
Description
Issue: Output of Get-AzVMRunCommand does not display any other fields apart from Name and Location, which are not useful (because they are input itself).
ASK: mentioned at the bottom of description
PS C:> Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivW0 -RunCommandName RunPowerShellScript14
Location Name
eastus2 RunPowerShellScript14
PS C:> Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivW0 -RunCommandName RunPowerShellScript14 -Expand InstanceView
Location Name
eastus2 RunPowerShellScript14
When I use " | Format-List", all the output fields are displayed. PS C:> Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivW0 -RunCommandName RunPowerShellScript14 -Expand InstanceView | Format-List
AsyncExecution : False ErrorBlobUri : https://vivst.blob.core.windows.net/vivcontainer/error.txt Id : /subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/VivRG0/providers/Microsoft.Compute/virtualMachines/VivW0/runCommands/RunPowerShellScript14 InstanceViewEndTime : 6/8/2022 8:37:21 PM InstanceViewError : 'st' is not recognized as an internal or external command, operable program or batch file. 'se' is not recognized as an internal or external command, operable program or batch file. 'spr' is not recognized as an internal or external command, operable program or batch file. 'sv' is not recognized as an internal or external command, operable program or batch file. 'sr' is not recognized as an internal or external command, operable program or batch file. 'sig' is not recognized as an internal or external command, operable program or batch file. 'st' is not recognized as an internal or external command, operable program or batch file. 'se' is not recognized as an internal or external command, operable program or batch file. 'spr' is not recognized as an internal or external command, operable program or batch file. 'sv' is not recognized as an internal or external command, operable program or batch file. 'sr' is not recognized as an internal or external command, operable program or batch file. 'sig' is not recognized as an internal or external command, operable program or batch file. InstanceViewExecutionMessage : InstanceViewExecutionState : Failed InstanceViewExitCode : 1 InstanceViewOutput : Directory: C:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 6/8/2022 8:37 PM 0 Temp0608_14.txt
InstanceViewStartTime : 6/8/2022 8:37:21 PM InstanceViewStatuses : Location : eastus2 Name : RunPowerShellScript14 OutputBlobUri : https://vivst.blob.core.windows.net/vivcontainer/output.txt Parameter : ProtectedParameter : ProvisioningState : Succeeded RunAsPassword : RunAsUser : SourceCommandId : SourceScript : New-Item -Path C:\ -Name Temp0608_14.txt -ItemType file SourceScriptUri : Tag : Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.ResourceTags TimeoutInSecond : 0 Type : Microsoft.Compute/virtualMachines/runCommands
ASK: We can't expect users to know and use "Format-List" to access output when they use cmdlet programmatically. By default, when the Get-AzVMRunCommand is executed, could you change format such that all output fields are displayed ?
Issue script & Debug output
NA
Environment data
NA
Module versions
NA
Error output
No response
| Author: | vivlingaiah |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | - |
Hi, I'm from CRP. The service does return the fields and its values. I believe this is just issue with formatting of cmdlet output.
ADO item tracking this work.
@vivlingaiah This item has been added to the CPlat PS backlog. Thank you.
Get-AzVmRunCommand cmdlet has made InstanceView available with Az 8.3.0 module. Thanks for fixing it!
However, Get RunCommand list seems to be broken
Also, Get-AzVMSSVMRunCommand has the same issue for InstanceView. Could you please fix it as well ? and Get-AzVMSSVMRunCommand as well. Thanks in advance !