Publish-​Azure​VM​Dsc​Configuration

Publishes a desired state configuration script to Azure blob storage.

Syntax

Publish-AzureVMDscConfiguration
       [-ConfigurationPath] <String>
       [-AdditionalPath <String[]>]
       [-ConfigurationArchivePath <String>]
       [-ConfigurationDataPath <String>]
       [-Force]
       [-InformationAction <ActionPreference>]
       [-InformationVariable <String>]
       [-PassThru]
       [-Profile <AzureSMProfile>]
       [-SkipDependencyDetection]
       [-Confirm]
       [-WhatIf]
       [<CommonParameters>]
Publish-AzureVMDscConfiguration
       [-ConfigurationPath] <String>
       [-AdditionalPath <String[]>]
       [-ConfigurationDataPath <String>]
       [-ContainerName <String>]
       [-Force]
       [-InformationAction <ActionPreference>]
       [-InformationVariable <String>]
       [-PassThru]
       [-Profile <AzureSMProfile>]
       [-SkipDependencyDetection]
       [-StorageContext <AzureStorageContext>]
       [-StorageEndpointSuffix <String>]
       [-Confirm]
       [-WhatIf]
       [<CommonParameters>]

Description

The Publish-AzureVMDscConfiguration cmdlet publishes a desired state configuration script to Azure blob storage, which later can be applied to Azure virtual machines using the Set-AzureVMDscExtension cmdlet.

Examples

Example 1: Publish a state configuration script to blob storage

PS C:\> Publish-AzureVMDscConfiguration .\MyConfiguration.ps1

This command creates a .zip package for the given script and any dependent resource modules and uploads it to Azure storage.

Example 2: Publish a state configuration script to a local file

PS C:\> Publish-AzureVMDscConfiguration .\MyConfiguration.ps1 -ConfigurationArchivePath .\MyConfiguration.ps1.zip

This command creates a .zip package for the given script and any dependent resource modules and stores it in the local file .\MyConfiguration.ps1.zip.

Required Parameters

-ConfigurationPath

Specifies the path of a file that contains one or more configurations. The file can be a Windows PowerShell script (.ps1 file), module (.psm1 file), or an archive (.zip file) that contains a set of Windows PowerShell modules, with each module in a separate directory.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-AdditionalPath

Specifies an array of additional paths.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ConfigurationArchivePath

Specifies the path of a local .zip file that this cmdlet writes the configuration archive. The configuration script is not uploaded to Azure blob storage if you use this parameter.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ConfigurationDataPath

Specifies a configuration data path.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

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

Specifies the name of the Azure storage container the configuration is uploaded to.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

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

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

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

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SkipDependencyDetection

Indicates that this cmdlet skips dependency detection.

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

Specifies the Azure storage context that provides the security settings used to upload the configuration script to the container specified by the ContainerName parameter. This context provides write access to the container.

Type:AzureStorageContext
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-StorageEndpointSuffix

Specifies the suffix for the storage end-point, for instance, core.contoso.net

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