편집

다음을 통해 공유


Import-AzAutomationDscNodeConfiguration

Imports a MOF document as a DSC node configuration in Automation.

Syntax

Import-AzAutomationDscNodeConfiguration
      -Path <String>
      -ConfigurationName <String>
      [-Force]
      [-ResourceGroupName] <String>
      [-AutomationAccountName] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-IncrementNodeConfigurationBuild]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Import-AzAutomationDscConfiguration cmdlet imports a Managed Object Format (MOF) configuration document into Azure Automation as a Desired State Configuration (DSC) node configuration. Specify the path of a .mof file.

Examples

Example 1: Import a DSC node configuration into Automation

Import-AzAutomationDscNodeConfiguration -AutomationAccountName "Contoso17" -ResourceGroupName "ResourceGroup01" -ConfigurationName "ContosoConfiguration" -Path "C:\DSC\webserver.mof" -Force

This command imports a DSC node configuration from the file named webserver.mof into the Automation account named Contoso17, under the DSC configuration ContosoConfiguration. The command specifies the Force parameter. If there is an existing DSC node configuration named ContosoConfiguration.webserver, this command replaces it.

Example 2: Import a DSC node configuration into Automation and create a new build version and not overwrite existing NodeConfiguration.

Import-AzAutomationDscNodeConfiguration -AutomationAccountName "Contoso17" -ResourceGroupName "ResourceGroup01" -ConfigurationName "ContosoConfiguration" -Path "C:\DSC\webserver.mof" -IncrementNodeConfigurationBuild

This command imports a DSC node configuration from the file named webserver.mof into the Automation account named Contoso17, under the DSC configuration ContosoConfiguration. The command specifies the Force parameter. If there is an existing DSC node configuration named ContosoConfiguration.webserver, this command adds a new build version with the name ContosoConfiguration[2].webserver.

Parameters

-AutomationAccountName

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

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

-ConfigurationName

Specifies the name of a DSC configuration in Automation to use as the namespace and container for the node configuration to import.

Type:String
Position:Named
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

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

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

-IncrementNodeConfigurationBuild

Creates a new Node Configuration build version.

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

-Path

Specifies the path of the MOF configuration document that this cmdlet imports.

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

-ResourceGroupName

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

Type:String
Position:0
Default value:None
Required:True
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

Outputs

NodeConfiguration