< Back

Set-AzureVMDscExtension

Wed Jan 30, 2019 5:54 pm

NAME Set-AzureVMDscExtension



SYNOPSIS

Configures the DSC extension on a virtual machine.





SYNTAX

Set-AzureVMDscExtension [-ConfigurationArchive] <String> [-ReferenceName <String>] [-ConfigurationArgument <Hashtable>] [-ConfigurationDataPath

<String>] [-ConfigurationName <String>] [-ContainerName <String>] [-Force] [-StorageContext <AzureStorageContext>] [-Version <String>]

[-StorageEndpointSuffix <String>] [-WmfVersion <String>] [-DataCollection <String>] -VM <IPersistentVM> [-Profile <AzureSMProfile>] [-InformationAction

<ActionPreference>] [-InformationVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

The Set-AzureVMDscExtension cmdlet configures the Desired State Configuration (DSC) extension on a virtual machine.





PARAMETERS

-ReferenceName <String>

Specifies a user-defined string that can be used to refer to an extension. This parameter is specified when the extension is added to the virtual

machine for the first time. For subsequent updates, you should specify the previously used reference name while you update the extension. The

ReferenceName assigned to an extension is returned using the Get-AzureVM cmdlet.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ConfigurationArgument <Hashtable>

Specifies a hashtable specifying the arguments to the configuration function. The keys correspond to the parameter names and the values to the

parameter values.



The acceptable values for this parameter are:



-- primitive types



-- string



-- array



-- PSCredential



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 function. This file must contain a hashtable as described in

http://technet.microsoft.com/en-us/libr ... 49925.aspx.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ConfigurationArchive <String>

Specifies the name of the configuration package (.zip file) that was previously uploaded by Publish-AzureVMDscConfiguration. This parameter must

specify only the name of the file, without any path.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ConfigurationName <String>

Specifies the name of the configuration script or module that is invoked by the DSC extension.



The value of this parameter must be the name of one of the configuration functions contained in the scripts or modules packaged in

ConfigurationArchive.



This cmdlet defaults to the name of the file given by the ConfigurationArchive parameter if you omit this parameter, excluding any extension. For

instance, if ConfigurationArchive is "SalesWebSite.ps1.zip", the default value for ConfigurationName is "SalesWebSite".



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ContainerName <String>

Specifies the name of the Azure storage container where the ConfigurationArchive is located.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Force [<SwitchParameter>]

Indicates that this cmdlet overwrites existing blobs.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-StorageContext <AzureStorageContext>

Specifies the Azure storage context that provides the security settings used to access the configuration script. This context provides read access

to the container specified by the ContainerName parameter.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Version <String>

Specifies the specific version of the DSC extension to use. The default value is set to "1.*" if this parameter is not specified.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageEndpointSuffix <String>

Specifies the DNS endpoint suffix for all storage services, for instance, "core.contoso.net".



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-WmfVersion <String>

Specifies the version of the Windows Management Framework (WMF) to install on the VM. The DSC Azure Extension depends on DSC features that are only

available in the WMF updates. This parameter specifies which version of the update to install on the VM. The possible values are

"4.0","5.0","5.1","latest". A value of "latest" will install the latest WMF, currently WMF 5.1. The default value is "latest"



Required? false

Position? named

Default value Latest

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DataCollection <String>

Enables or Disables Data Collection in the extension. It is enabled if it is not specified. The value is persisted in the extension between calls.

Allowed Values are: Enable and Disable



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-VM <IPersistentVM>

Specifies the persistent virtual machine object.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue, ByPropertyName)

Accept wildcard characters? false



-Profile <AzureSMProfile>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.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



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.



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 (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- Example 1: Configure the DSC extension on a virtual machine --------------------------



PS C:\\>Set-AzureVMDscExtension -VM $VM -ConfigurationArchive MyConfiguration.ps1.zip -ConfigurationName MyConfiguration -ConfigurationArgument @{ Path

= 'C:\\MyDirectory' }

DeploymentName : my-vm-svc

Name : my-vm

Label :

VM : Microsoft.WindowsAzure.Commands.ServiceManagement.Model.PersistentVM

InstanceStatus : ReadyRole

IpAddress : 10.10.10.10

InstanceStateDetails :

PowerState : Started

InstanceErrorCode :

InstanceFaultDomain : 0

InstanceName : my-vm

InstanceUpgradeDomain : 0

InstanceSize : Small

AvailabilitySetName :

DNSName : http://my-vm-svc.cloudapp.net/

Status : ReadyRole

GuestAgentStatus : Microsoft.WindowsAzure.Commands.ServiceManagement.Model.PersistentVMModel.GuestAgentStatus

ResourceExtensionStatusList : {Contoso.Compute.BGInfo}

PublicIPAddress :

PublicIPName :

ServiceName : my-vm-svc

OperationDescription : Get-AzureVM

OperationId : a0217a7af900c1f8a212299a3333cdbd6

OperationStatus : OK



This command configures the DSC extension on a virtual machine.

-------------------------- Example 2: Configure the DSC extension on a virtual machine using a path to the configuration data

--------------------------



PS C:\\>$VM | Set-AzureVMDscExtension -ConfigurationArchive MyConfiguration.ps1.zip -ConfigurationName MyConfiguration -ConfigurationArgument @{

Credential = Get-Credential } -ConfigurationDataPath MyConfigurationData.psd1

DeploymentName : my-vm-svc

Name : my-vm

Label :

VM : Microsoft.WindowsAzure.Commands.ServiceManagement.Model.PersistentVM

InstanceStatus : ReadyRole

IpAddress : 10.10.10.10

InstanceStateDetails :

PowerState : Started

InstanceErrorCode :

InstanceFaultDomain : 0

InstanceName : my-vm

InstanceUpgradeDomain : 0

InstanceSize : Small

AvailabilitySetName :

DNSName : http://my-vm-svc.cloudapp.net/

Status : ReadyRole

GuestAgentStatus : Microsoft.WindowsAzure.Commands.ServiceManagement.Model.PersistentVMModel.GuestAgentStatus

ResourceExtensionStatusList : {Microsoft.Compute.BGInfo, Microsoft.Powershell.DSC}

PublicIPAddress :

PublicIPName :

ServiceName : my-vm-svc

OperationDescription : Get-AzureVM

OperationId : a0217a7af900c1f8a212299a3333cdbd7

OperationStatus : OK



This command configures the DSC extension on a virtual machine using a path to the configuration data.



RELATED LINKS

Get-AzureVMDscExtension

Remove-AzureVMDscExtension

Remove-AzureVMDscExtension

Get-AzureVM

Publish-AzureVMDscConfiguration