Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit focus mode

Microsoft Desired State Configuration overview

  • 2025-06-09
Feedback

In this article

Microsoft's Desired State Configuration (DSC) is a declarative configuration platform. With DSC,the state of a machine is described using a format that should be clear to understand even if thereader isn't a subject matter expert. Unlike imperative tools, with DSC the definition of anapplication environment is separate from programming logic that enforces that definition.

The DSC command line application (dsc) abstracts the management of software componentsdeclaratively and idempotently. DSC runs on Linux, macOS, and Windows without any externaldependencies.

With DSC, you can:

  • Author DSC Resources to manage your systems in any language.
  • Invoke individual resources directly.
  • Create configuration documents that define the desired state of a system.

Configuration Documents

DSC Configuration Documents are declarative data files that define instances of resources.Typically, configuration documents define what state to enforce. DSC supports writing configurationdocuments in both JSON and YAML.

Example scenarios include requirements for an application environment or operational/securitystandards.

DSC Resources

DSC Resources define how to manage state for a particular system or application component.Resources describe a schema for the manageable settings of the component. Every resource can beused with theGet andTest operations to retrieve the current state of a resource instanceand validate whether it's in the desired state. Most resources also support enforcing the desiredstate with theSet operation.

Example scenarios include:

  • How to update the contents of a file.
  • How to run a utility that changes the state of a machine.
  • How to configure settings of an application.

Differences from PowerShell DSC

DSC differs from PowerShell Desired State Configuration (PSDSC) in a few important ways:

  • DSC doesn'tdepend on PowerShell, Windows PowerShell, or thePSDesiredStateConfigurationPowerShell module. DSC provides full compatibility with PSDSC resources through theMicrosoft.DSC/PowerShell andMicrosoft.Windows/WindowsPowerShelladapter resources.

    With theMicrosoft.DSC/PowerShell adapter resource, you can use any PSDSC resource implementedas a PowerShell class. The resource handles discovering, validating, and invoking PSDSCresources in PowerShell. The resource is included in the DSC install package for every platform.

    With theMicrosoft.Windows/WindowsPowerShell adapter resource, you can use any PSDSC resourcecompatible with Windows PowerShell. The resource handles discovering, validating, and invokingPSDSC resources in Windows PowerShell. The resource is included in the DSC install packages forWindows only.

  • Because DSC doesn't depend on PowerShell, you can use DSC without PowerShell installed and manageresources written in bash, Python, C#, Rust, or any other language.

  • DSC doesn't include a local configuration manager. DSC is invoked as a command. It doesn'trun as a service.

  • New DSC resources define their schemas with JSON or YAML files, not MOF files. Self-containedresources define aresource manifest that indicates how DSC should invoke the resource and whatproperties the resource can manage. For adapted resources, like those implemented in PowerShell,the adapter resource tells DSC what the available properties are for the resource and handlesinvoking the adapted resources.

  • Configuration documents are defined in JSON or YAML files, not PowerShell script files.Configuration documents support a subset of functionality in ARM templates, including parameters,variables, metadata, and expression functions to dynamically resolve data in the configuration.

Installation

Install DSC manually

To install DSC on any platform:

  1. Download thelatest release from the PowerShell/DSC repository.
  2. Expand the release archive.
  3. Add the folder containing the expanded archive contents to thePATH.

Install DSC on Windows with WinGet

The following commands can be used to install DSC using the publishedwinget packages from theMicrosoft Store:

Search for the latest version of DSC:

winget search DesiredStateConfiguration --source msstore
Name                              Id           Version Source---------------------------------------------------------------DesiredStateConfiguration         9NVTPZWRC6KQ Unknown msstoreDesiredStateConfiguration-Preview 9PCX3HX4HZ0Z Unknown msstore

Install DSC using theid parameter:

# Install latest stablewinget install --id 9NVTPZWRC6KQ --source msstore
# Install latest previewwinget install --id 9PCX3HX4HZ0Z --source msstore

Integrating with DSC

DSC is a platform tool that abstracts the concerns for defining and invoking resources. Higherorder tools, likeWinGet,Microsoft Dev Box, andAzure Machine Configuration areearly partners for DSC as orchestration agents.

DSC uses JSON schemas to define the structure of resources, configuration documents, and theoutputs that DSC returns. These schemas make it easier to integrate DSC with other tools, becausethey standardize and document how to interface with DSC.

For more information, seeDSC JSON Schema reference overview.

See Also

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNo

In this article

Was this page helpful?

YesNo