< Back

Set-AzureRmVMDscExtension

Tue Jan 29, 2019 9:39 pm

NAME Set-AzureRmVMDscExtension



SYNOPSIS

Configures the DSC extension on a virtual machine.





SYNTAX

Set-AzureRmVMDscExtension [-Version] <String> [-ResourceGroupName] <String> [-VMName] <String> [-ArchiveStorageAccountName] <String>

[-ArchiveBlobName] <String> [-ArchiveContainerName <String>] [-ArchiveResourceGroupName <String>] [-ArchiveStorageEndpointSuffix <String>]

[-AutoUpdate] [-ConfigurationArgument <Hashtable>] [-ConfigurationData <String>] [-ConfigurationName <String>] [-DataCollection {Enable |

Disable}] [-DefaultProfile <IAzureContextContainer>] [-Force] [-Location <String>] [-Name <String>] [-WmfVersion {4.0 | 5.0 | 5.1 | latest}]

[-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Set-AzureRmVMDscExtension cmdlet configures the Windows PowerShell Desired State Configuration (DSC) extension on a virtual machine in a

resource group.





PARAMETERS

-ArchiveBlobName <String>

Specifies the name of the configuration file that was previously uploaded by the Publish-AzureRmVMDscConfiguration cmdlet.



Required? true

Position? 5

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ArchiveContainerName <String>

Species name of the Azure storage container where the configuration archive is located.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ArchiveResourceGroupName <String>

Specifies the name of the resource group that contains the storage account that contains the configuration archive. This parameter is optional

if the storage account and virtual machine are both in the same resource group.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ArchiveStorageAccountName <String>

Specifies the Azure storage account name that is used to download the ArchiveBlobName.



Required? true

Position? 4

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ArchiveStorageEndpointSuffix <String>

Specifies the storage endpoint suffix.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-AutoUpdate [<SwitchParameter>]

Specifies the extension handler version specified by the Version parameter. By default extension handler is not autoupdated. Use the

AutoUpdate parameter to enable auto update of the extension handler to the latest version as and when it is available.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-ConfigurationArgument <Hashtable>

Specifies a hash table that contains the arguments to the configuration function.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ConfigurationData <String>

Specifies the path of a .psd1 file that specifies the data for the configuration.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ConfigurationName <String>

Specifies the name of the configuration that the DSC Extension invokes.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DataCollection <String>

Specifies the data collection type. The acceptable values for this parameter are: Enable and Disable.



Required? false

Position? named

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



-Location <String>

Specifies the path of the resource extension.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

Specifies the name of the Azure Resource Manager resource that represents the extension. The default value is Microsoft.Powershell.DSC.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group of the virtual machine.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Version <String>

Specifies the version of the DSC extension that Set-AzureRmVMDscExtension applies the settings to.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-VMName <String>

Specifies the name of the virtual machine where DSC extension handler is installed.



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-WmfVersion <String>

Specifies the WMF version.



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

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Compute.Models.PSAzureOperationResponse







NOTES









Example 1: Set a DSC extension



PS C:\\> Set-AzureRmVMDscExtension -ResourceGroupName "ResourceGroup001" -VMName "VM07" -ArchiveBlobName "Sample.ps1.zip"

-ArchiveStorageAccountName "Stg" -ConfigurationName "ConfigName" -Version "1.10" -Location "West US"



This command sets the DSC extension on the virtual machine named VM07 to download Sample.ps1.zip from the storage account named Stg and the

default container. The command invokes the configuration named ConfigName. The Sample.ps1.zip file was previously uploaded by using

Publish-AzureRmVMDscConfiguration .





Example 2: Set a DSC extension with configuration data



PS C:\\> Set-AzureRmVMDscExtension -ResourceGroupName "ResourceGroup001" -VMName "VM13" -ArchiveBlobName "Sample.ps1.zip"

-ArchiveStorageAccountName "Stg" -ConfigurationName "ConfigName" -ConfigurationArgument "@{arg="val"}" -ArchiveContainerName

"WindowsPowerShellDSC" -ConfigurationData "SampleData.psd1" -Version "1.10" -Location "West US"



This command sets the extension on the virtual machine named VM13 to download Sample.ps1.zip from the storage account named Stg and the container

named WindowsPowerShellDSC. The command the configuration named ConfigName and specifies configuration data and arguments. The Sample.ps1.zip file

was previously uploaded by using Publish-AzureRmVMDscConfiguration .





Example 3: Set a DSC extension with configuration data that has auto update



PS C:\\> Set-AzureRmVMDscExtension -ResourceGroupName "ResourceGroup001" -VMName "VM22" -ArchiveBlobName "Sample.ps1.zip"

-ArchiveStorageAccountName "Stg" -ConfigurationName "ConfigName" -ConfigurationArgument "@{arg="val"}" -ArchiveContainerName WindowsPowerShellDSC

-ConfigurationData "SampleData.psd1" -Version "1.10" -Location "West US" -AutoUpdate



This command sets the extension on the virtual machine named VM22 to download Sample.ps1.zip from the storage account named Stg and the container

named WindowsPowerShellDSC. The command invokes the configuration named ConfigName and specifies configuration data and arguments. This command

also enables auto update of extension handler to the latest version. The Sample.ps1.zip was previously uploaded by using

Publish-AzureRmVMDscConfiguration .







RELATED LINKS

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

Get-AzureRmVMDscExtension

Remove-AzureRmVMDscExtension

Publish-AzureRmVMDscConfiguration