To run commands in VMs in Azure

az vm run-command invoke  --command-id RunPowerShellScript --name win-vm -g my-resource-group --scripts @script.ps1 --parameters "arg1=somefoo" "arg2=somebar"

Alternatively chose “run command” in Azure portal web image

Updated: