Skip to content

Commit a562dd6

Browse files
authored
Update run-command-managed.md
CLI command below doesn’t work as expected. axel@Azure:~$ az vm run-command show --name "myRunCommand" --vm-name "VM290918005" --resource-group "RG290918005" --expand argument --expand: expected one argument Examples from AI knowledge base: az vm run-command show --resource-group "myResourceGroup" --run-command-name "myRunCommand" --vm-name "myVM" Get the run commands in the virtual machine. az vm run-command show --command-id "RunPowerShellScript" --location "SoutheastAsia" Get specific run command for a subscription in a location. https://aka.ms/cli_ref Read more about the command in reference docs That documentation says it should display the execution status & results: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/run-command-managed#get-execution-status-and-results Get execution status and results This command will retrieve current execution progress, including latest output, start/end time, exit code, and terminal state of the execution. Azure CLICopy az vm run-command show --name "myRunCommand" --vm-name "myVM" --resource-group "myRG" --expand Had a quick look at the source code, and I’m under the impression that we should use “--instance-view” instead of “--expand” – am I correct? “--instance-view” gives me a different output: axel@Azure:~$ az vm run-command show --name "myRunCommand" --vm-name "VM290918005" --resource-group "RG290918005" --instance-view { "asyncExecution": false, "errorBlobUri": null, "id": "/subscriptions/6eb19024-265b-4bce-8dd6-394e287cbc1a/resourceGroups/RG290918005/providers/Microsoft.Compute/virtualMachines/vm290918005/runCommands/myRunCommand", "instanceView": { "endTime": "2022-02-24T10:10:34.090832+00:00", "error": null, "executionMessage": null, "executionState": "Succeeded", "exitCode": 0, "output": "Hello World!", "startTime": "2022-02-24T10:10:27.290514+00:00", "statuses": null }, "location": "westeurope", "name": "myRunCommand", "outputBlobUri": null, "parameters": null, "protectedParameters": null, "provisioningState": "Succeeded", "resourceGroup": "RG290918005", "runAsPassword": null, "runAsUser": null, "source": { "commandId": null, "script": "Write-Host Hello World!", "scriptUri": null }, "tags": null, "timeoutInSeconds": 0, "type": "Microsoft.Compute/virtualMachines/runCommands" }  Should we update the public documentation?
1 parent bda5904 commit a562dd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

articles/virtual-machines/windows/run-command-managed.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ az vm run-command list --name "myVM" --resource-group "myRG"
5858
This command will retrieve current execution progress, including latest output, start/end time, exit code, and terminal state of the execution.
5959

6060
```azurecli-interactive
61-
az vm run-command show --name "myRunCommand" --vm-name "myVM" --resource-group "myRG" --expand
61+
az vm run-command show --name "myRunCommand" --vm-name "myVM" --resource-group "myRG" --instance-view
6262
```
6363

6464
### Delete RunCommand resource from the VM

0 commit comments

Comments
 (0)