Import-AzureRmAutomationDscNodeConfiguration

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

Syntax

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

Description

The Import-AzureRmAutomationDscConfiguration 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

PS C:\>Import-AzureRmAutomationDscConfiguration -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.

PS C:\>Import-AzureRmAutomationDscConfiguration -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.

Required 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
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Path

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

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:System.Management.Automation.SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

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

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IncrementNodeConfigurationBuild

Creates a new Node Configuration build version.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

Type:System.Management.Automation.SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.Azure.Commands.Automation.Model.NodeConfiguration