Editar

Partilhar via


Export-AzAutomationRunbook

Exports an Automation runbook.

Syntax

Export-AzAutomationRunbook
      [-Name] <String>
      [-Slot <String>]
      [-OutputFolder <String>]
      [-Force]
      [-ResourceGroupName] <String>
      [-AutomationAccountName] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Export-AzAutomationRunbook cmdlet exports an Azure Automation runbook to a wps_2 script (.ps1 ) file, for wps_2 or wps_2 Workflow runbooks, or to a graphical runbook (.graphrunbook) file, for graphical runbooks. The name of the runbook becomes the name of the exported file.

Examples

Example 1: Export a runbook

Export-AzAutomationRunbook -ResourceGroupName "ResourceGroup01" -AutomationAccountName "ContosoAutomationAccount" -Name "Runbook03" -Slot "Published" -OutputFolder "C:\Users\PattiFuller\Desktop"

This command exports the published version of an Automation runbook to a user desktop.

Parameters

-AutomationAccountName

Specifies the name of the Automation account in which this cmdlet exports a runbook.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

ps_force

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the runbook that this cmdlet exports. The name of the runbook becomes the name of the export file.

Type:String
Aliases:RunbookName
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-OutputFolder

Specifies the path of a folder in which this cmdlet creates the export file.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

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

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Slot

Specifies whether this cmdlet exports the draft or published content of the runbook. Valid values are:

  • Published
  • Draft
Type:String
Accepted values:Published, Draft
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

DirectoryInfo