summary import { VirtualMachineRunCommandUpdate , ComputeManagementClient } from "@msinternal/compute-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function updateVirtualMachineScaleSetVMRunCommand ( ) { const subscriptionId = "{subscription-id}" ; const resourceGroupName = "myResourceGroup" ; const vmScaleSetName = "myvmScaleSet" ; const instanceId = "0" ; const runCommandName = "myRunCommand" ; const runCommand = { source : { script : "Write-Host Script Source Updated!" } } ; const credential = new DefaultAzureCredential ( ) ; const client = new ComputeManagementClient ( credential , subscriptionId ) ; const result = await client . virtualMachineScaleSetVMRunCommands . beginUpdateAndWait ( resourceGroupName , vmScaleSetName , instanceId , runCommandName , runCommand ) ; console . log ( result ) ; } updateVirtualMachineScaleSetVMRunCommand ( ) . catch ( console . error ) ;