Az vm run-command

From UVOO Tech Wiki
Revision as of 20:47, 4 April 2022 by Busk (talk | contribs) (Created page with "``` Examples from AI knowledge base: az vm run-command invoke --resource-group MyResourceGroup --name MyVm --command-id RunShellScript --scripts "sudo apt-get update && sudo a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Examples from AI knowledge base:
az vm run-command invoke --resource-group MyResourceGroup --name MyVm --command-id RunShellScript --scripts "sudo apt-get update && sudo apt-get install
Install nginx on a linux VM.

az vm run-command invoke --command-id RunPowerShellScript --name win-vm --resource-group my-resource-group --scripts 'param([string]$arg1,[string]$arg2)' 'Write-Host This is a sample script with parameters $arg1 and $arg2' --parameters 'arg1=somefoo' 'arg2=somebar' --parameters 'arg1=somefoo'
Run powershell script on a windows VM with parameters. Script supplied inline. Be wary of single-quoting in CMD.exe.

https://docs.microsoft.com/en-US/cli/azure/vm/run-command#az_vm_run_command_invoke