Skip to content

Conversation

@eiffel-fl
Copy link

Hi.

In this PR, I added a new output mode: cmd.
The main goal of this output mode is to be used when running a command in a VM or VMSS, so it display the output as if it is was printed locally instead of having the output stored inside JSON object which leads to loss of formatting:

# Without cmd
$ az vmss run-command invoke ... --command-id RunShellScript --instance-id 0 --scripts 'echo "foo\tbar\tquux\ncorge"' -o json
{
  "value": [
    {
      "code": "ProvisioningState/succeeded",
      "displayStatus": "Provisioning succeeded",
      "level": "Info",
      "message": "Enable succeeded: \n[stdout]\nfoo\tbar\tquux\ncorge\n\n[stderr]\n",
      "time": null
    }
  ]
}
# With cmd
$ az vmss run-command invoke ... --command-id RunShellScript --instance-id 0 --scripts 'echo "foo\tbar\tquux\ncorge"' -o cmd
foo     bar     quux
corge

If you have any comments to make this contribution better, feel free to share.

Best regards and thank you in advance.

This new output is thought to be used when executing a command in a VM/VMSS.
It permits to print the output of the command like if this was executed locally.

Signed-off-by: Francis Laniel <[email protected]>
@eiffel-fl eiffel-fl force-pushed the francis/new-output-mode branch from 65400ed to 162e599 Compare January 16, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant