Skip to content

VMware.PSDesiredStateConfiguration - v1.0

Compare
Choose a tag to compare
@SimeonGerginov SimeonGerginov released this 24 Feb 15:39
· 5 commits to master since this release

VMware.PSDesiredStateConfiguration module provides a set of cmdlets to compile and execute a DSC Configuration without using the DSC Local Configuration Manager. Compiled DSC Configurations are stored in memory as PowerShell objects.

Start-VmwDscConfiguration, Get-VmwDscConfiguration and Test-VmwDscConfiguration cmdlets use the Invoke-DSCResource cmdlet from the PSDesiredStateConfiguration module to execute the compiled DSC Configurations.

The VMware.PSDesiredStateConfiguration module provides a cross platform support on MacOS and Linux. The module is also designed to work with the existing DSC Resources from the VMware.vSphereDSC module.

New-VmwDscConfiguration

Compiles a DSC Configuration into a VmwDscConfiguration object, which contains the name of the DSC Configuration and the DSC Resources defined in it.

Parameters

Mandatory

  • Path - A file path of a file that contains DSC Configurations. The file can contain multiple DSC Configurations and for each one, a separate VmwDscConfiguration object is created. If ConfigurationData hashtable is defined in the provided file, it is passed to each DSC Configuration defined in the file.

Optional

  • ConfigurationName - The name of the DSC Configuration which should be compiled into a VmwDscConfiguration object. This parameter is applicable only when multiple DSC Configurations are defined in the file and only one specific DSC Configuration should be compiled. If not specified, all DSC Configurations in the file are compiled and returned as VmwDscConfiguration objects.

  • Parameters - The parameters of the file that contains the DSC Configurations as a hashtable where each key is the parameter name and each value is the parameter value.

Start, Test and Get-VmwDscConfiguration

These cmdlets work with the VmwDscConfiguration object created by the New-VmwDscConfiguration cmdlet and apply the Set, Test, Get methods to the compiled DSC Configuration.

Parameters

Mandatory

  • Configuration - A VmwDscConfiguration object compiled by the New-VmwDscConfiguration cmdlet.

Optional

  • ConnectionFilter - An array of Node names on which the DSC Configuration should be executed. Nodes that are not in the list will be skipped. Node names can be strings or VIServer objects.

The module also exposes vSphereNodes, which represent connections to vCenter Servers.

vSphere Nodes

Inside a DSC Configuration a vSphereNode is a special dynamic keyword that represents a connection to a VIServer. Each vSphereNode can contain DSC Resources from the module VMware.vSphereDSC. Currently vSphere Nodes only work on PowerShell 7.

With standard DSC we need to supply each DSC Resource with a Server and Credential properties so that they can establish a connection to the specified VIServer because the LCM runs the DSC Resources in different runspaces and a common connection cannot be reused.

The vSphere Nodes along with the new execution engine allow the user to bundle DSC Resources and specify a common VIServer connection which gets reused.