Add-AzVmssRunCommand
Adding Run Command to VMSS instances
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Add-AzVmssRunCommand
[-ResourceGroupName] <String>
[-VMScaleSetName] <String>
[-Location] <String>
[-CommandId <String>]
-Name <String>
[-ScriptPath <String>]
[-ScriptUri <String>]
[-Script <String>]
[-TimeOutInSeconds <String>]
[-ErrorBlobUri <String>]
[-OutputBlobUri <String>]
[-RunAsUser <String>]
[-RunAsPassword <SecureString>]
[-Parameter <Hashtable>]
[-ProtectedParameter <Hashtable>]
[-AsyncExecution <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Add-AzVmssRunCommand
[-CommandId <String>]
-Name <String>
[-ScriptPath <String>]
[-ScriptUri <String>]
[-Script <String>]
[-TimeOutInSeconds <String>]
[-ErrorBlobUri <String>]
[-OutputBlobUri <String>]
[-RunAsUser <String>]
[-RunAsPassword <SecureString>]
[-Parameter <Hashtable>]
[-ProtectedParameter <Hashtable>]
[-AsyncExecution <Boolean>]
[-VirtualMachineScaleSetVM] <PSVirtualMachineScaleSetVM>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Adding Run Command to All VMSS Instances
Examples
Example 1
Add-AzVmssRunCommand -ResourceGroupName $rgname -VMScaleSetName $vmssname -Location eastus -Name myruncommand -Script "Write-Host Hello World" -TimeOutInSeconds 3600 -RunAsUser "admin01"
Adding 'myruncommand' to VMSS
Parameters
Run cmdlet in the background
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete.
| Type: | Boolean |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
RunCommand Id
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the Azure storage blob where script error stream will be uploaded.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Resource location
| Type: | String |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Resource name
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the Azure storage blob where script output stream will be uploaded.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The parameters used by the script.
| Type: | Hashtable |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The parameters used by the script.
| Type: | Hashtable |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Resource Group Name
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the user account password on the VM when executing the run command.
| Type: | SecureString |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the user account on the VM when executing the run command.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The source of the run command script.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The Path of source of the run command script.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The Uri source of the run command script.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The timeout in seconds to execute the run command.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The VirtualMachineScaleSetVM
| Type: | PSVirtualMachineScaleSetVM |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The VirtualMachineScaleSet
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |