Member-only story

Optimizing Your DSC V3 Authoring Experience in VSCode

Gijs Reijn
5 min readJun 1, 2024

--

The world around DSC has changed significantly; only some of the components to talk to the DSC engine are written in PowerShell. Instead, the authoring of configurations is written in YAML or JSON.

Figure 1 — YAML or JSON

Previous versions of DSC were closed and you couldn’t have a look under the hood of the engine. Now, DSC V3 is totally rewritten and open-sourced on GitHub. The engine itself doesn’t require a Local Configuration Manager (LCM) anymore.

Instead, you become responsible for the orchestration of configurations to machines. Also, the team working behind DSC V3 has promised that any language can be used to write DSC resources.

To prevent a bit of misunderstanding, let’s clarify: configuration documents outline the desired state of a machine, and the resource executes the necessary tasks with some required information in DSC V3.

That said, you can already see that the PowerShell extension is not going to be enough to help your authoring experience in VSCode.

So, what are the things that can optimize the authoring experience in VSCode for DSC V3?

In this article, you’ll learn 3 tricks that boost your authoring experience when working with the new DSC version.

1. Have you Completed your Tab?

You know, normally spoken if you want to apply a configuration, you would call the Invoke-DscResource cmdlet. When you had the Integrated PowerShell Terminal open in VSCode, it would assist you when you pressed “Tab” on the parameter that could be used.

DSC V3 doesn’t have that, instead, it is a native executable you need to call. Luckily, the team has introduced a command called completer that generates a shell completion script that you can add to your profile.

Figure 2 — DSC completer command

This can give you tab completion assistance if you add it to your profile. To add it to your PowerShell profile, follow the below steps.

  1. In your Integrated PowerShell terminal session, execute dsc completer powershell | clip

--

--

Gijs Reijn
Gijs Reijn

Written by Gijs Reijn

Sharing my experience through the IT world. Tutorials, guides, and opinions. Microsoft MVP and author at LeanPub.

No responses yet

Write a response