Import-AzAutomationRunbook
Imports an Automation runbook.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Import-AzAutomationRunbook
[-Path] <String>
[-Description <String>]
[-Name <String>]
[-Tags <IDictionary>]
-Type <String>
[-LogProgress <Boolean>]
[-LogVerbose <Boolean>]
[-Published]
[-Force]
[-ResourceGroupName] <String>
[-AutomationAccountName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Import-AzAutomationRunbook cmdlet imports an Azure Automation runbook. Specify the path to a wps_2 script (.ps1) file to import for wps_2 and wps_2 Workflow runbooks, (.graphrunbook) file for graphical runbooks, or (.py) file for python 2 runbooks. For wps_2 Workflow runbooks, the script must contain a single wps_2 Workflow definition that matches the name of the file.
Examples
Example 1: Import a runbook from a file
PS C:\> $Tags = @{"tag01"="value01"; "tag02"="value02"}
PS C:\> Import-AzAutomationRunbook -Path .\GraphicalRunbook06.graphrunbook -Tags $Tags -ResourceGroupName "ResourceGroup01" -AutomationAccountName "AutomationAccount01" -Type GraphicalPowershell
The first command assigns two key/value pairs to the $Tags variable. The second command imports a graphical runbook called GraphicalRunbook06 into the Automation account named AutomationAccount01. The command also assigns the tags stored in $Tags.
Example 2
Imports an Automation runbook. (autogenerated)
Import-AzAutomationRunbook -AutomationAccountName 'AutomationAccount01' -Name 'Configuration01' -Path .\GraphicalRunbook06.graphrunbook -Published -ResourceGroupName 'ResourceGroup01' -Type PowerShell
Parameters
Specifies the name of the Automation account into which this cmdlet imports a runbook.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | False |
| 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 a description for the imported runbook.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
ps_force
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies whether the runbook logs progress information.
| Type: | Nullable<T>[Boolean] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies whether the runbook logs detailed information.
| Type: | Nullable<T>[Boolean] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the name of the runbook that this cmdlet imports.
| Type: | String |
| Aliases: | RunbookName |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the path of a .ps1 or .graphrunbook file that this cmdlet imports.
| Type: | String |
| Aliases: | SourcePath |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Indicates that this cmdlet publishes the runbook that it imports.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the resource group for which this cmdlet imports a runbook.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Key-value pairs in the form of a hash table. For example: @{key0="value0";key1=$null;key2="value2"}
| Type: | IDictionary |
| Aliases: | Tag |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the type of runbook that this cmdlet creates. Valid values are:
- PowerShell
- GraphicalPowerShell
- PowerShellWorkflow
- GraphicalPowerShellWorkflow
- Graph
- Python2 The value Graph is obsolete. It is equivalent to GraphicalPowerShellWorkflow.
| Type: | String |
| Accepted values: | PowerShell, GraphicalPowerShell, PowerShellWorkflow, GraphicalPowerShellWorkflow, Graph, Python2, Python3 |
| 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: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
Nullable<T>[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]