You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 15, 2026. It is now read-only.
linktitle: 'DSC v3 Oversimplified: Three Ways to Author and Invoke Configuration Documents'
8
+
title: 'DSC v3 Oversimplified: Three Ways to Author and Invoke Configuration Documents'
9
+
---
10
+
11
+
DSC's v3 engine isn't the only way to invoke a configuration document. Nor does the authoring have to happen purely in DSC v3 format.
12
+
13
+
Configuration documents for DSC v3 are written in YAML and JSON. If you come from the old days, that can surprise you. Configuration documents were originally solely written in PowerShell.
14
+
15
+
DSC v3, or now changed to Microsoft DSC 3.0, does it differently. And for several reasons. One of those is the fact that DSC in itself is an executable that can be executed from orchestration tools. Think of Azure Machine Configuration, which, quite frankly, was also available for DSC v2.
16
+
17
+
This blog post was posted on [Medium](https://medium.com/@gijsreijn/dsc-v3-oversimplified-three-ways-to-author-and-invoke-configuration-documents-639a138e3e5d).
linktitle: The Three Straightforward Ways To Get Microsoft's DSC v3 Input Properties
8
+
title: The Three Straightforward Ways To Get Microsoft's DSC v3 Input Properties
9
+
---
10
+
11
+
Microsoft DSC v3 introduced command-based and non-command-based DSC resources (adapter).
12
+
13
+
This fundamental change has changed the way you can retrieve the input properties. Typically, you would use the Get-DscResource command to discover the available properties on script-based and class-based DSC resources.
14
+
15
+
Because Microsoft DSC v3 is a command-line interface (CLI) application that uses JSON and YAML, retrieving the input properties doesn’t work using the command mentioned earlier.
16
+
17
+
This blog post was posted on [Medium](https://medium.com/@gijsreijn/the-three-straightforward-ways-to-get-microsofts-dsc-v3-input-properties-771a5e3b02e8).
Copy file name to clipboardExpand all lines: content/docs/getting-started.md
+3-9Lines changed: 3 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ To install DSC for Windows from GitHub, follow these steps:
11
11
12
12
### Step 1 - Determine your OS architecture
13
13
14
-
There are multiple ways to determine the operating system (OS) architecture. The following three demonstrate using the command prompt PowerShell, or msinfo.
14
+
There are multiple ways to determine the operating system (OS) architecture. The following three demonstrate using the command prompt, PowerShell, or msinfo.
15
15
16
16
1. Open a command prompt and type: `echo %PROCESSOR_ARCHITECTURE%`.
17
17
2. Open a PowerShell terminal session and type: `[System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture`.
@@ -39,7 +39,7 @@ When the download is finished, you can expand the files to extract them to your
39
39
40
40
1. Right-click the file and select _Extract All..._
41
41
2. Extract the files to `C:\Users\<userProfile>\AppData\Local\dsc` by replacing the `<userProfile>` with your profile name.
42
-
3. Open a command prompt and type `rundll32.exe sysdm.cpl,EditEnvironmentVariables` to open the environment variables.
42
+
3. Open a command prompt and type:`rundll32.exe sysdm.cpl,EditEnvironmentVariables` to open the environment variables.
43
43
4. In your user variables, edit your `PATH` environment variable and include the path `C:\Users\<userProfile>\AppData\Local\dsc`.
44
44
45
45
### Step 4 - Verify the installation
@@ -53,12 +53,6 @@ When the download is finished, you can expand the files to extract them to your
53
53
54
54
This should return the DSC version installed.
55
55
56
-
{{< figure
57
-
src="/images/dsc-version.png"
58
-
alt="DSC version"
59
-
caption="Figure 2: The DSC version installed"
60
-
>}}
61
-
62
56
> [!IMPORTANT]
63
57
> After the files are extracted, make sure the files are unblocked in your file system.
64
58
@@ -83,7 +77,7 @@ To install DSC using the PSDSC module, follow the below steps:
83
77
Install-DscExe
84
78
```
85
79
86
-
This installs DSC in your `"$env:LOCALAPPDAT\dsc"` folder. To verify the result, run `dsc --version`
80
+
This installs DSC in your `$env:LOCALAPPDAT\dsc` folder. To verify the result, run `dsc --version`
Copy file name to clipboardExpand all lines: content/docs/initiate/level-1-the-basics.md
+8-13Lines changed: 8 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ To display the possible values for each option, you can simply type in: `dsc` in
50
50
caption="Figure 1: The commands and options available"
51
51
>}}
52
52
53
-
If you're unsure about a command, you can always ask the CLI for help. This applies to each subcommand. For example, to get help for the config command, type: `dsc config --help`.
53
+
If you're unsure about a command, you can always ask the CLI for help. This applies to each subcommand. For example, to get help for the `config` command, type: `dsc config --help`.
54
54
55
55
```plaintext
56
56
Apply a configuration document
@@ -67,7 +67,7 @@ Commands:
67
67
...
68
68
```
69
69
70
-
You now know how you can ask the CLI for help, but what about DSC resources in general? Before looking at a DSC resource and run it, it will be helpful to have a completion script registered. A completion script allows you to easily perform socalled tab-completions when using the CLI from a command-line shell, like PowerShell or the Bash terminal. The following steps demonstrates how you can add a completion script in a PowerShell profile:
70
+
You now know how you can ask the CLI for help, but what about DSC resources in general? Before looking at a DSC resource and running it, it will be helpful to have a completion script registered. A completion script allows you to easily perform so-called tab-completions when using the CLI from a command-line shell, like PowerShell or the Bash terminal. The following steps demonstrate how you can add a completion script in a PowerShell profile:
71
71
72
72
1. Open a PowerShell session.
73
73
2. Execute `dsc completer powershell | clip` to add the completion script to the clipboard.
@@ -82,7 +82,7 @@ Depending on the version of PowerShell you are using, once you have added the co
82
82
83
83
## Executing Your First DSC Resource
84
84
85
-
To run your first DSC resource, you need to understand what a DSC resource is. A DSC resource allows you to define the desired state of a specific part of your system and ensures it remains in that state. The logic behind a DSC resource can be written in any programming language, such as a bash script, a .NET executable, or a CLI written in Rust. As long as the tool you create follows certain schema semantics, it can be used as a DSC resource.
85
+
To run your first DSC resource, it's important to understand what a DSC resource actually is. At its core, a DSC resource is a package of code that lets you define the desired state for a specific part of your system — whether that's a Windows Server, an iMac, or Linux machine — and ensures it stays in that state when enforced by orchestration tools. What makes DSC resources flexible is that they can be written in virtually any programming language. You could use bash scripts, create a .NET executable, or even CLIs written in Rust. The only requirement is that your code adheres to the schema semantics of `dsc`, allowing it to participate and be utilized as a _DSC resource_.
86
86
87
87
Now you know what a DSC resource is, you need to know how to find them. To do so, you can use the `dsc resource list` command. What the command will do in the background is the following:
88
88
@@ -94,7 +94,7 @@ Now you know what a DSC resource is, you need to know how to find them. To do so
94
94
-`.dsc.resource.yml`
95
95
-`.dsc.resource.yaml`
96
96
97
-
If files with these suffixes are found in the mentioned directories, DSC will load them, search for the required elements, and display the results in the console. If the required elements are missing, DSC will provide a warning indicating which properties are absent. The following output shows what DSC has found. These are the builtin resources when you've installed DSC.
97
+
If files with these suffixes are found in the mentioned directories, DSC will load them, search for the required elements, and display the results in the console. If the required elements are missing, DSC will provide a warning indicating which properties are absent. The following output shows what DSC has found. These are the builtin resources when you've installed DSC on a Windows OS.
98
98
99
99
```plaintext
100
100
Type Kind Version Capabilities RequireAdapter Description
> For now, don't worry about the suffix. You'll learn more about it in the next level.
117
117
118
-
It can be an excruciating list at first sight. That's why it can be filtered down to focus on the `Resource` kind for now. The following command demonstrates how to find all DSC resources of type `resource`.
118
+
To filter down the list, you can focus on the `resource` kind for now. The following command demonstrates how to find all DSC resources of type `resource`.
You now have a filtered list of DSC resources that are builtin when you've installed DSC.
137
+
You now have a filtered list of _command-based_DSC resources that are builtin.
138
138
139
139
> [!IMPORTANT]
140
140
> The output shown is from a Windows machine. If you are using a different operating system, the output may be different.
141
141
142
142
In the output table when `dsc resource list` is run, flags such as `gs--t---` are displayed. When the output is piped (|) and converted with `ConvertFrom-Json`, the actual capability full names are shown. This demonstrates what the resource has implemented and what capabilities you can call using `dsc resource <capability>`.
143
143
144
-
You got the first piece how you can call the DSC resource. Let's pick the `Microsoft/OSInfo` resource. If you want to use the `get` capability, the command would start with `dsc resource get --resource Microsoft/OSInfo`. There is only one piece missing to execute the DSC resource: what input _might_ be required to interact with it?
144
+
You got the first piece how you can call the DSC resource. Let's pick the `Microsoft/OSInfo` resource to experiment with. If you want to use the `get` capability, the command would start with `dsc resource get --resource Microsoft/OSInfo`. There is only one piece missing to execute the DSC resource: what input _might_ be required to interact with it?
145
145
146
146
DSC resources follow a certain schema. You should see a schema somewhat as a contract when you purchase a house. In the contract it clearly states what will be _in_ the house and what you will get _out_ of it when you purchase it. To see such contract, or schema, you can use the `dsc resource schema` command. When you want to display it for the `Microsoft/OSInfo` resource, you can run:
147
147
@@ -214,15 +214,10 @@ You have successfully ran your first DSC resource. Before making things to compl
214
214
215
215
You've already learned the `--help` option for each subcommand. Make this a habit if you aren't certain about a command. Each time you append the `--help` option, it will reveal the help information.
216
216
217
-
The official documentation is published on Microsoft Learn, the platform from Microsoft for all learning materials. You can find it using the following link: <https://learn.microsoft.com/en-us/powershell/>. In the tiles you can search and find _PowerShell DSC_.
217
+
The official documentation is published on Microsoft Learn, the platform from Microsoft for all learning materials. You can find it using the following link: <https://learn.microsoft.com/en-us/powershell/>. In the tiles you can search and find _Microsoft DSC_.
218
218
219
219
To stay up to date with the latest releases, you can check out the official repository at: <https://github.com/PowerShell/DSC/releases>. Always keep your CLI version up to date to get the latest functionality and bug fixes!
220
220
221
-
There is also a YouTube channel to follow, which is the official DSC community channel found at: <https://www.youtube.com/@dsccommunity2958>. The DSC community itself also has:
222
-
223
-
- Twitter at @dsccommunity
224
-
- Discord in the following link: <https://discordapp.com/invite/AtzXnJM>
225
-
226
221
## Lab Questions
227
222
228
223
You have now successfully learned about the basics and executed your first DSC resource. It's time to reinforce your understanding by completing the following lab questions:
0 commit comments