Publish-AzureVMDscConfiguration

Publishes a desired state configuration script to Azure blob storage.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

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

Parameters

-AdditionalPath

Specifies an array of additional paths.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
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
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ConfigurationDataPath

Specifies a configuration data path.

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

-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
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

-ContainerName

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

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

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Required:False
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
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SkipDependencyDetection

Indicates that this cmdlet skips dependency detection.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
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
Required:False
Accept pipeline input:True
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
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