microsoft/winget-dsc/convert-to-v3

Claude Code and agent skill by microsoft/winget-dsc

Trust tier 4
  • vendor
  • ext:[{"type":"config","description":"Configuration overrides"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Converts WinGet Configuration files from DSC schema v0.2 (v2) to the dscv3 processor syntax (v3). Use this skill when asked to convert, migrate, or upgrade a WinGet Configuration file from v2 to v3, or when working with .winget configuration files that need to be updated to the dscv3 schema.

Install

npx vskill@latest install microsoft/winget-dsc/convert-to-v3

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as microsoft/winget-dsc/convert-to-v3.

WinGet Configuration v2 → v3 Conversion Skill

You are an expert at converting WinGet Configuration files from DSC schema v0.2 (v2) to the dscv3 processor syntax (v3). Follow these rules precisely.

Document Structure

v2 structure
yaml
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
configurationVersion: 0.2.0
assertions:
- resource: ...
resources:
- resource: ...
v3 structure
yaml
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
metadata:
winget:
processor:
identifier: dscv3
resources:
- type: ...

Key changes:

  • Remove the properties: wrapper and configurationVersion
  • Remove assertions: section (v3 does not support assertions in the same way)
  • Add $schema pointing to the DSC v3 schema
  • Add metadata.winget.processor.identifier: dscv3
  • Resources move to a top-level resources: array

Field Renaming

Apply these renames to every resource:

v2 Fieldv3 Field
resource:type:
id:name:
settings:properties:
directives:metadata:
Example

v2:

yaml
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: git
directives:
description: Install Git
allowPrerelease: true
settings:
id: Git.Git
source: winget

v3:

yaml
- type: Microsoft.WinGet/Package
name: Git
properties:
id: Git.Git
source: winget
useLatest: true
metadata:
description: Install Git

Resource Type Mapping

v2 Resource Typev3 Resource TypeNotes
Microsoft.WinGet.DSC/WinGetPackageMicrosoft.WinGet/PackageRenamed
PSDscResources/Registry`Microsoft.Windows/Registry`Use native v3 resource — dramatically faster
PSDscResources/ScriptMicrosoft.DSC.Transitional/RunCommandOnSetOr PowerShellScript/WindowsPowerShellScript if test support needed
PSDscResources/WindowsOptionalFeatureMicrosoft.Windows/OptionalFeatureListNative v3, batch multiple features in one resource
Microsoft.Windows.Developer/*Microsoft.Windows.Developer/*Unchanged (adapted resource, requires module install)
Microsoft.Windows.Settings/*Microsoft.Windows.Settings/*Unchanged (adapted resource, requires module install)

CRITICAL: Always prefer `Microsoft.Windows/Registry` over `PSDscResources/Registry`. The native v3 resource evaluates in ~3 seconds per key with linear scaling. The adapted PSDscResources/Registry takes 89–228 seconds per key with super-linear growth. For a configuration with 22 registry keys, this is the difference between ~2 minutes and 30+ minutes. Using the native resource also eliminates the need to install the PSDscResources module.

Package Resources (Microsoft.WinGet/Package)

Properties changes
  • Add useLatest: true to properties (replaces the concept of always getting latest)
  • Remove allowPrerelease: true from directives/metadata (this was a v2 directive)
  • The source: winget property remains the same
Security Context / Elevation

CRITICAL: Do NOT blindly add `securityContext: elevated` to package installs.

Before adding securityContext: elevated to any package resource, check the package's installer manifest in the microsoft/winget-pkgs repository for the ElevationRequirement field:

  • elevationRequired → Yes, add securityContext: elevated
  • elevatesSelf → No, the installer handles its own UAC prompt
  • No ElevationRequirement field → No, elevation is not needed
  • Portable/zip installers → No, never need elevation
  • MSIX installers → No, never need elevation

To check, look up the installer manifest at: manifests/<first-letter>/<Publisher>/<Package>/<Version>/<Id>.installer.yaml

When elevation IS needed, add it in metadata:

yaml
metadata:
winget:
securityContext: elevated
description: ...
Common packages and their elevation requirements
PackageElevationRequirementNeeds elevated?
Git.GitelevatesSelfNo
GitHub.ClielevatesSelfNo
GitHub.CopilotNone (portable)No
Microsoft.PowerShellelevatesSelf (MSI)No
Microsoft.VisualStudioCodeNoneNo
Python.Python.3.xelevatesSelf (machine)No
astral-sh.uvNone (portable)No
OpenJS.NodeJSelevatesSelfNo
JanDeDobbeleer.OhMyPoshNone (MSIX)No
Microsoft.PowerToyselevatesSelf (machine)No
Microsoft.WSLNoneNo
Canonical.UbuntuNone (MSIX)No

Class-Based DSC Resources (PowerShell Modules)

In v2, PowerShell class-based DSC resources (like PSDscResources/Registry, Microsoft.Windows.Developer/*, Microsoft.Windows.Settings/*) are handled automatically by the WinGet DSC processor.

In v3, the dscv3 processor does NOT know about v2-style PowerShell DSC resources. You must explicitly install the PowerShell modules using Microsoft.DSC.Transitional/RunCommandOnSet before any resources that depend on them.

Required module installs

For each PowerShell DSC module used, add a RunCommandOnSet resource that installs it. All module installs depend on PowerShell 7 being installed first.

CRITICAL: Only use `-AllowPrerelease` when no stable version exists on the PowerShell Gallery.

Check the PowerShell Gallery before adding -Prerelease:

powershell
Find-PSResource -Name <ModuleName> # Check for stable
Find-PSResource -Name <ModuleName> -Prerelease # Check for prerelease
Known module status (verify before use — this may change)
ModuleStable Available?Needs -AllowPrerelease?
PSDscResourcesYes (2.12.0.0)No
Microsoft.Windows.SettingsNo (alpha only)Yes
Microsoft.Windows.DeveloperNo (alpha only)Yes
Module install pattern

Use Install-PSResource (built into PowerShell 7) rather than the older Install-Module:

yaml
- type: Microsoft.DSC.Transitional/RunCommandOnSet
name: Microsoft.Windows.Developer.Module
dependsOn:
- PowerShell
properties:
executable: C:\Program Files\PowerShell\7\pwsh.exe
arguments:
"0": -NoProfile
"1": -NoLogo
"2": -Command
"3": >-
if (-not (Get-Module -ListAvailable -Name Microsoft.Windows.Developer))
{ Install-PSResource -Name Microsoft.Windows.Developer -Prerelease
-TrustRepository -AcceptLicense }
treatAsArray: true
metadata:
description: Ensure Microsoft.Windows.Developer module is installed

For modules with a stable release (no -Prerelease flag needed):

yaml
"3": >-
if (-not (Get-Module -ListAvailable -Name PSDscResources))
{ Install-PSResource -Name PSDscResources
-TrustRepository -AcceptLicense }
Dependency chain

Resources using these modules MUST have dependsOn pointing to the module install resource:

yaml
- type: Microsoft.Windows.Developer/EnableLongPathSupport
name: LongPaths
dependsOn:
- Microsoft.Windows.Developer.Module
properties:
Ensure: Present
metadata:
winget:
securityContext: elevated
description: Enable Win32 long paths

PSDscResources/Script → RunCommandOnSet

v2 PSDscResources/Script resources have GetScript, TestScript, and SetScript blocks. In v3, these become Microsoft.DSC.Transitional/RunCommandOnSet which only runs the set logic. Combine the test and set logic into the command argument.

Alternative: If you need proper test/get/set separation, use
Microsoft.DSC.Transitional/PowerShellScript (runs in pwsh 7) or
Microsoft.DSC.Transitional/WindowsPowerShellScript (runs in Windows PowerShell 5.1).
These have getScript, testScript, and setScript properties and can properly report
whether the system is already in the desired state. Performance is comparable to RunCommandOnSet.
Example conversion

v2:

yaml
- resource: PSDscResources/Script
id: ps7default
dependsOn:
- powershell
directives:
description: Set PowerShell 7 as default Windows Terminal profile
settings:
GetScript: |
return @{ Result = $false }
TestScript: |
# test logic here
return $false
SetScript: |
# set logic here

v3:

yaml
- type: Microsoft.DSC.Transitional/RunCommandOnSet
name: ps7default
dependsOn:
- PowerShell
properties:
executable: C:\Program Files\PowerShell\7\pwsh.exe
arguments:
"0": -NoProfile
"1": -NoLogo
"2": -Command
"3": |
# Combined test + set logic here
treatAsArray: true
metadata:
description: Set PowerShell 7 as default Windows Terminal profile

Registry Resources — Use Native Microsoft.Windows/Registry

CRITICAL: Convert all `PSDscResources/Registry` to `Microsoft.Windows/Registry`.

The native v3 resource is a completely different (and far superior) resource:

  • No PowerShell module install needed
  • No adapter overhead
  • ~3 seconds per key vs 89–228 seconds
  • Linear scaling vs super-linear growth
Property mapping
v2 (PSDscResources/Registry)v3 (Microsoft.Windows/Registry)Notes
Key: HKLM:\SOFTWARE\...keyPath: HKLM\SOFTWARE\...Drop the :\ — use HKLM\ not HKLM:\
Key: HKCU:\SOFTWARE\...keyPath: HKCU\SOFTWARE\...Drop the :\ — use HKCU\ not HKCU:\
ValueName: NamevalueName: NamecamelCase
ValueType: DWord + ValueData: '3'valueData: { DWord: 3 }Type is embedded in the data object
ValueType: String + ValueData: textvalueData: { String: "text" }Type is embedded in the data object
ValueType: QWord + ValueData: '0'valueData: { QWord: 0 }Type is embedded in the data object
Ensure: Present_exist: trueDifferent existence model
Ensure: Absent_exist: falseDifferent existence model
Force: true(not needed)Native resource handles this
dependsOn: [PSDscResources.Module](not needed)No module dependency
Conversion example

v2:

yaml
- resource: PSDscResources/Registry
id: sudo
directives:
description: Enable Sudo in inline mode
allowPrerelease: true
securityContext: elevated
settings:
Key: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Sudo
ValueName: Enabled
ValueType: DWord
ValueData: '3'
Force: true
Ensure: Present

v3:

yaml
- type: Microsoft.Windows/Registry
name: Sudo
properties:
keyPath: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Sudo
valueName: Enabled
valueData:
DWord: 3
_exist: true
metadata:
winget:
securityContext: elevated
description: Enable Sudo in inline mode
Value data types
Registry Typev3 FormatExample
DWordvalueData: { DWord: 3 }32-bit integer
QWordvalueData: { QWord: 0 }64-bit integer
StringvalueData: { String: "text" }String value
ExpandStringvalueData: { ExpandString: "%PATH%" }Expandable string
MultiStringvalueData: { MultiString: ["a", "b"] }Array of strings
BinaryvalueData: { Binary: [0, 1, 2] }Array of bytes
NonevalueData: NoneNo data
Elevation rules for Registry
  • HKLM\ keys → add metadata.winget.securityContext: elevated
  • HKCU\ keys → no elevation needed

Security Context in v3

In v2, elevation was specified per-resource in directives.securityContext.

In v3, elevation is specified in metadata.winget.securityContext:

yaml
metadata:
winget:
securityContext: elevated
description: ...

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 2 Jul 2026.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
145
Repository forks
46
7-day trend score
25

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 May 2026, 6 months ago.

Extension points

  • configConfiguration overrides

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill CERTIFIED badge
[![vskill CERTIFIED](https://verified-skill.com/api/v1/skills/microsoft/winget-dsc/convert-to-v3/badge)](https://verified-skill.com/skills/microsoft/winget-dsc/convert-to-v3)

Something wrong with this skill or its page? Tell us.