Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Set-AzureVMDscExtension

Set-AzureVMDscExtension

microsoft.windowsazure.commands.servicemanagement.dll

Synopsis

Configure the Windows PowerShell Desired State Configuration extension on a VM.

Syntax

Set-AzureVMDscExtension [-ReferenceName] [-ConfigurationArgument] [-ConfigurationDataPath] [-ConfigurationArchive] [-ConfigurationName] [-ContainerName] [-Force] [-StorageContext] [-Version] [-StorageEndpointSuffix] [-VM] [-WhatIf] [-Confirm] [<CommonParameters>]

Detailed Description

Configure the Windows PowerShell Desired State Configuration extension on a VM.

Parameters

-ReferenceName <String>

This is a user-defined string that can be used to refer to an extension. It is specified when the extension is added to the VM for the first time. For subsequent updates, user should specify the previously used reference name while updating the extension. The ReferenceName assigned to an extension will be returned using the Get-AzureVM cmdlet.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ConfigurationArgument <Hashtable>

A hashtable specifying the arguments to the configuration function. The keys correspond to the parameter names and the values to the parameter values. Supported types for values include: primitive types, string, array and PSCredential.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ConfigurationDataPath <String>

The path to 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/library/dn249925.aspx.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ConfigurationArchive <String>

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.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ConfigurationName <String>

Name of the configuration script or module that will be invoked by the DSC Extension. The value of this parameter must be the name of one of the configurations functions contained in the scripts or modules packaged in the ConfigurationArchive. If omitted, this parameter will default to the name of the file given by the ConfigurationArchive parameter, excluding any extension, for example if ConfigurationArchive is "SalesWebSite.ps1.zip", the default value for ConfigurationName will be "SalesWebSite".

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-ContainerName <String>

Name of the Azure Storage Container where the ConfigurationArchive is located.

Aliases

None

Required?

false

Position

named

Default value

WindowsPowerShellDSC

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Force <SwitchParameter>

By default Set-AzureVMDscExtension will not overwrite any existing blobs. Use -Force to overwrite them.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-StorageContext <AzureStorageContext>

The Azure Storage Context that provides the security settings used to access the configuration script. This context should provide read access to the container specified by ContainerName.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Version <String>

The specific version of the DSC Extension to use. If not given, it will default to "1.*"

Aliases

None

Required?

false

Position

named

Default value

1.*

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-StorageEndpointSuffix <String>

The DNS endpoint suffix for all storage services, e.g. "core.windows.net".

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-VM <IPersistentVM>

The persistent VM object.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByValue, ByPropertyName)

Accept wildcard characters?

false

-WhatIf <SwitchParameter>

Describes what would happen if you executed the command without actually executing the command.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Confirm <SwitchParameter>

Prompts you for confirmation before executing the command.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

-------------------------- EXAMPLE 1 --------------------------

Description

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 : {Microsoft.Compute.BGInfo}
PublicIPAddress             : 
PublicIPName                : 
ServiceName                 : my-vm-svc
OperationDescription        : Get-AzureVM
OperationId                 : a0217a7af900c1f8a212299a3333cdbd6
OperationStatus             : OK

-------------------------- EXAMPLE 2 --------------------------

Description

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

Unknown