< Back

Publish-AzureRmVMDscConfiguration

Tue Jan 29, 2019 9:38 pm

NAME Publish-AzureRmVMDscConfiguration



SYNOPSIS

Uploads a DSC script to Azure blob storage.





SYNTAX

Publish-AzureRmVMDscConfiguration [-ConfigurationPath] <String> [-ResourceGroupName] <String> [-StorageAccountName] <String> [[-ContainerName]

<String>] [-AdditionalPath <String[]>] [-ConfigurationDataPath <String>] [-DefaultProfile <IAzureContextContainer>] [-Force]

[-SkipDependencyDetection] [-StorageEndpointSuffix <String>] [-Confirm] [-WhatIf] [<CommonParameters>]



Publish-AzureRmVMDscConfiguration [-ConfigurationPath] <String> [[-OutputArchivePath] <String>] [-AdditionalPath <String[]>]

[-ConfigurationDataPath <String>] [-DefaultProfile <IAzureContextContainer>] [-Force] [-SkipDependencyDetection] [-Confirm] [-WhatIf]

[<CommonParameters>]





DESCRIPTION

The Publish-AzureRmVMDscConfiguration cmdlet uploads a Desired State Configuration (DSC) script to Azure blob storage, which later can be applied

to Azure virtual machines using the Set-AzureRmVMDscExtension cmdlet.





PARAMETERS

-AdditionalPath <String[]>

Specifies the path of a file or a directory to include in the configuration archive. It gets downloaded to the virtual machine together with

the configuration.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ConfigurationDataPath <String>

Specifies the path of a .psd1 file that specifies the data for the configuration. This is added to the configuration archive and then passed

to the configuration function. It gets overwritten by the configuration data path provided through the Set-AzureRmVMDscExtension cmdlet



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ConfigurationPath <String>

Specifies the path of a file that contains one or more configurations. The file can be a Windows PowerShell script (.ps1) file or a Windows

PowerShell module (.psm1) file.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



-ContainerName <String>

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



Required? false

Position? 4

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-OutputArchivePath <String>

Specifies the path of a local .zip file to write the configuration archive to. When this parameter is used, the configuration script is not

uploaded to Azure blob storage.



Required? false

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group that contains the storage account.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SkipDependencyDetection [<SwitchParameter>]

Indicates that this cmdlet excludes DSC resource dependencies from the configuration archive.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-StorageAccountName <String>

Specifies the Azure storage account name that is used to upload the configuration script to the container specified by the ContainerName

parameter.



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageEndpointSuffix <String>

Specifies the suffix for the storage end point.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs.



The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

String

Parameter 'ConfigurationPath' accepts value of type 'String' from the pipeline





OUTPUTS

System.String







NOTES









Example 1: Create a .zip package an upload it to Azure storage



PS C:\\> Publish-AzureRmVMDscConfiguration ".\\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: Create a .zip package and store it to a local file



PS C:\\> Publish-AzureRmVMDscConfiguration ".\\MyConfiguration.ps1" -OutputArchivePath ".\\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 that is named

.\\MyConfiguration.ps1.zip.





Example 3: Add configuration to the archive and then upload it to storage



PS C:\\> Publish-AzureRmVMDscConfiguration -ConfigurationPath "C:\\Sample.ps1" -SkipDependencyDetection



This command adds configuration named Sample.ps1 to the configuration archive to upload to Azure storage and skips dependent resource modules.





Example 4: Add configuration and configuration data to the archive and then upload it to storage



PS C:\\> Publish-AzureRmVMDscConfiguration -ConfigurationPath "C:\\Sample.ps1" -ConfigurationDataPath "C:\\SampleData.psd1"



This command adds configuration named Sample.ps1 and configuration data named SampleData.psd1 to the configuration archive to upload to Azure

storage.





Example 5: Add configuration, configuration data, and additional content to the archive and then upload it to storage



PS C:\\> Publish-AzureRmVMDscConfiguration -ConfigurationPath "C:\\Sample.ps1" -AdditionalPath @("C:\\ContentDir1", "C:\\File.txt")

-ConfigurationDataPath "C:\\SampleData.psd1"



This command adds configuration named Sample.ps1, configuration data SampleData.psd1, and additional content to configuration archive to upload to

Azure storage.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... figuration

Get-AzureRmVMDscExtension

Remove-AzureRmVMDscExtension

Set-AzureRmVMDscExtension