< Back

Import-AzureRmAutomationRunbook

Tue Jan 29, 2019 9:32 pm

NAME Import-AzureRmAutomationRunbook



SYNOPSIS

Imports an Automation runbook.





SYNTAX

Import-AzureRmAutomationRunbook [-ResourceGroupName] <String> [-AutomationAccountName] <String> [-Path] <String> [-DefaultProfile

<IAzureContextContainer>] [-Description <String>] [-Force] [-LogProgress <Boolean>] [-LogVerbose <Boolean>] [-Name <String>] [-Published] [-Tags

<IDictionary>] -Type {PowerShell | GraphicalPowerShell | PowerShellWorkflow | GraphicalPowerShellWorkflow | Graph | Python} [-Confirm] [-WhatIf]

[<CommonParameters>]





DESCRIPTION

The Import-AzureRmAutomationRunbook 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.





PARAMETERS

-AutomationAccountName <String>

Specifies the name of the Automation account into which this cmdlet imports a runbook.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Description <String>

Specifies a description for the imported runbook.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Force [<SwitchParameter>]

ps_force



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-LogProgress <Boolean>

Specifies whether the runbook logs progress information.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-LogVerbose <Boolean>

Specifies whether the runbook logs detailed information.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

Specifies the name of the runbook that this cmdlet imports.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Path <String>

Specifies the path of a .ps1 or .graphrunbook file that this cmdlet imports.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Published [<SwitchParameter>]

Indicates that this cmdlet publishes the runbook that it imports.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group for which this cmdlet imports a runbook.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Tags <IDictionary>

Key-value pairs in the form of a hash table. For example:



@{key0="value0";key1=$null;key2="value2"}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Type <String>

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.





Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Automation.Model.Runbook







NOTES









Example 1: Import a runbook from a file



PS C:\\> $Tags = @{"tag01"="value01"; "tag02"="value02"}

PS C:\\> Import-AzureRmAutomationRunbook -Path .\\GraphicalRunbook06.graphrunbook -Tags $Tags -ResourceGroup "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.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ionrunbook

Export-AzureRmAutomationRunbook

Get-AzureRmAutomationRunbook

New-AzureRmAutomationRunbook

New-AzureRmAutomationRunbook

Publish-AzureRmAutomationRunbook

Remove-AzureRmAutomationRunbook

Set-AzureRmAutomationRunbook

Start-AzureRmAutomationRunbook