Set-AzVMRunCommand
The operation to create or update the run command.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Set-AzVMRunCommand
-ResourceGroupName <String>
-RunCommandName <String>
-VMName <String>
-Location <String>
[-SubscriptionId <String>]
[-AsyncExecution]
[-ErrorBlobUri <String>]
[-OutputBlobUri <String>]
[-Parameter <IRunCommandInputParameter[]>]
[-ProtectedParameter <IRunCommandInputParameter[]>]
[-RunAsPassword <String>]
[-RunAsUser <String>]
[-SourceCommandId <String>]
[-SourceScript <String>]
[-SourceScriptUri <String>]
[-Tag <Hashtable>]
[-TimeoutInSecond <Int32>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-Confirm]
[-WhatIf]
[<CommonParameters>]
Description
The operation to create or update the run command.
Examples
Example 1: Simple Example
Set-AzVMRunCommand -ResourceGroupName $rgname -VMName $vmname -RunCommandName 'firstruncommand'
Location Name Type
-------- ---- ----
eastus firstruncommand2 Microsoft.Compute/virtualMachines/runCommands
The Set-AzVMRunCommand cmdlet updates properties for existing run command or adds a new run command to a virtual machine.
Parameters
Run the command as a job
| 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: | SwitchParameter |
| 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: | PSObject |
| Aliases: | 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: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Run the command asynchronously
| Type: | SwitchParameter |
| 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. To construct, see NOTES section for PARAMETER properties and create a hash table.
| Type: | IRunCommandInputParameter[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The parameters used by the script. To construct, see NOTES section for PROTECTEDPARAMETER properties and create a hash table.
| Type: | IRunCommandInputParameter[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the resource group.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the user account password on the VM when executing the run command.
| Type: | String |
| 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 name of the virtual machine run command.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies a commandId of predefined built-in script.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the script content to be executed on the VM.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the script download location.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
| Type: | String |
| Position: | Named |
| Default value: | (Get-AzContext).Subscription.Id |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Resource tags
| Type: | Hashtable |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The timeout in seconds to execute the run command.
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the virtual machine where the run command should be created or updated.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| 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 |
Outputs
Notes
ALIASES
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
PARAMETER <IRunCommandInputParameter[]>: The parameters used by the script.
Name <String>: The run command parameter name.Value <String>: The run command parameter value.
PROTECTEDPARAMETER <IRunCommandInputParameter[]>: The parameters used by the script.
Name <String>: The run command parameter name.Value <String>: The run command parameter value.