Modifier

Partager via


Import-AzAutomationDscConfiguration

Imports a DSC configuration into Automation.

Syntax

Import-AzAutomationDscConfiguration
      -SourcePath <String>
      [-Tags <IDictionary>]
      [-Description <String>]
      [-Published]
      [-Force]
      [-LogVerbose <Boolean>]
      [-ResourceGroupName] <String>
      [-AutomationAccountName] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Import-AzAutomationDscConfiguration cmdlet imports an APS Desired State Configuration (DSC) configuration into Azure Automation. Specify the path of an APS script that contains a single DSC configuration.

Examples

Example 1: Import a DSC configuration into Automation

Import-AzAutomationDscConfiguration -AutomationAccountName "Contoso17" -ResourceGroupName "ResourceGroup01" -SourcePath "C:\DSC\client.ps1" -Force

This command imports the DSC configuration in the file named client.ps1 into the Automation account named Contoso17. The command specifies the Force parameter. If there is an existing DSC configuration, this command replaces it.

Example 2

Imports a DSC configuration into Automation. (autogenerated)

Import-AzAutomationDscConfiguration -AutomationAccountName 'Contoso17' -Published -ResourceGroupName 'ResourceGroup01' -SourcePath 'C:\DSC\client.ps1'

Parameters

-AutomationAccountName

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

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

-Description

Specifies a description of the configuration that this cmdlet imports.

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

-Force

Indicates that this cmdlet replaces an existing DSC configuration in Automation.

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

-LogVerbose

Specifies whether this cmdlet turns verbose logging on or off for compilation jobs of this DSC configuration. Specify a value of $True to turn verbose logging on or $False to turn it off.

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Published

Indicates that this cmdlet imports the DSC configuration in the published state.

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

-ResourceGroupName

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

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

-SourcePath

Specifies the path of the wps_2 script that contains the DSC configuration that this cmdlet imports.

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

-Tags

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
Required:False
Accept pipeline input:True
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

IDictionary

Nullable<T>[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

Outputs

DscConfiguration