summary import { RunCommandInput , ComputeManagementClient } from "@msinternal/compute-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function virtualMachineScaleSetVMSRunCommand ( ) { const subscriptionId = "{subscription-id}" ; const resourceGroupName = "myResourceGroup" ; const vmScaleSetName = "myVirtualMachineScaleSet" ; const instanceId = "0" ; const parameters = { commandId : "RunPowerShellScript" , script : [ "Write-Host Hello World!" ] } ; const credential = new DefaultAzureCredential ( ) ; const client = new ComputeManagementClient ( credential , subscriptionId ) ; const result = await client . virtualMachineScaleSetVMs . beginRunCommandAndWait ( resourceGroupName , vmScaleSetName , instanceId , parameters ) ; console . log ( result ) ; } virtualMachineScaleSetVMSRunCommand ( ) . catch ( console . error ) ;