Edit

Share via


Desired State Configuration 2.0

With the release of PowerShell 7.2, the PSDesiredStateConfiguration module is no longer included in the PowerShell package. Separating DSC into its own module allows us to invest and develop DSC independent of PowerShell and reduces the size of the PowerShell package. Users of DSC can enjoy the benefit of upgrading DSC without the need to upgrade PowerShell, accelerating time to deployment of new DSC features. Users that want to continue using DSC v2 can download PSDesiredStateConfiguration 2.0.7 from the PowerShell Gallery.

Users working with non-Windows environments can expect cross-platform features in DSC v3. For more information about the future of DSC, see the PowerShell Team blog.

To install PSDesiredStateConfiguration 2.0.7 from the PowerShell Gallery:

Install-Module -Name PSDesiredStateConfiguration -Repository PSGallery -MaximumVersion 2.99

Important

Be sure to include the parameter MaximumVersion or you could install version 3 (or higher) of PSDesireStateConfiguration that contains significant differences.

Use Case for DSC 2.0

DSC 2.0 is supported for use with Azure machine configuration. Other scenarios, such as directly calling DSC Resources with Invoke-DscResource, may be functional but aren't the primary intended use of this version.

If you aren't using Azure machine configuration, you should use DSC 1.1.machine

Changes from DSC 1.1

There are several major changes in DSC 2.0.

The only way to use DSC Resources in 2.0 is with the Invoke-DscResource cmdlet or Azure machine configuration.

The following cmdlets have been removed:

  • Disable-DscDebug
  • Enable-DscDebug
  • Get-DscConfiguration
  • Get-DscConfigurationStatus
  • Get-DscLocalConfigurationManager
  • Publish-DscConfiguration
  • Remove-DscConfigurationDocument
  • Restore-DscConfiguration
  • Set-DscLocalConfigurationManager
  • Start-DscConfiguration
  • Stop-DscConfiguration
  • Test-DscConfiguration
  • Update-DscConfiguration

The following features have been removed:

  • The pull server
  • The local configuration manager (LCM)

The following features aren't supported:

  • Multi-system DSC Configurations
  • Cross-system dependencies (the WaitFor* DSC Resources)
  • Rebooting behavior for DSC Resources
  • Adding parameters to DSC Configuration blocks
  • Using flow control statements in DSC Configuration blocks
  • Using credentials in DSC Configuration blocks
  • Using the ConfigurationData parameter with a DSC Configuration
  • Using the Node keyword in a DSC Configuration
  • Using composite DSC Configurations (DSC Configurations that nest another DSC Configuration inside them)

The built-in DSC Resources have been removed. The PSDscResources module includes replacements for some removed DSC Resources. Refer to the following table for the status of the DSC Resources.

DSC Resource Status
Archive Replaced by the Archive DSC Resource in PSDscResources.
Environment Replaced by the Environment DSC Resource in PSDscResources.
File Removed. This DSC Resource isn't available in DSC v2 and later.
Group Replaced by the Group DSC Resource in PSDscResources.
GroupSet Replaced by the GroupSet DSC Resource in PSDscResources.
Log Removed. This DSC Resource isn't available in DSC v2 and later.
Package Partially replaced by the MsiPackage DSC Resource in PSDscResources.
ProcessSet Replaced by the ProcessSet DSC Resource in PSDscResources.
Registry Replaced by the Registry DSC Resource in PSDscResources.
Script Replaced by the Script DSC Resource in PSDscResources.
Service Replaced by the Service DSC Resource in PSDscResources.
ServiceSet Replaced by the ServiceSet DSC Resource in PSDscResources.
User Replaced by the User DSC Resource in PSDscResources.
WaitForAll Removed. This DSC Resource isn't available in DSC v2 and later.
WaitForAny Removed. This DSC Resource isn't available in DSC v2 and later.
WaitForSome Removed. This DSC Resource isn't available in DSC v2 and later.
WindowsFeature Replaced by the WindowsFeature DSC Resource in PSDscResources.
WindowsFeatureSet Replaced by the WindowsFeatureSet DSC Resource in PSDscResources.
WindowsOptionalFeature Replaced by the WindowsOptionalFeature DSC Resource in PSDscResources.
WindowsOptionalFeatureSet Replaced by the WindowsOptionalFeatureSet DSC Resource in PSDscResources.
WindowsPackageCab Replaced by the WindowsPackageCab DSC Resource in PSDscResources.
WindowsProcess Replaced by the WindowsProcess DSC Resource in PSDscResources.