Skip to content

Install VSCode extensions using winget configure file #3958

Answered by Trenly
HeinvR asked this question in Q&A
Discussion options

You must be logged in to vote

The trick is finding the right DSC resource. Searching the PowerShell Gallery, I was able to find the vscode package. Once you import the module, you can use $(Get-DscResource).Where({$_.ModuleName -eq 'vscode'}) to see all the resources the module provides as well as what properties they accept.

Here's an example -

# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
# Reference: https://github.com/microsoft/winget-cli#building-the-client
properties:
  resources:
    - resource: vscode/VSCodeExtension
      directives:
        description: Install YAML Extension
        allowPrerelease: true
      settings:
        Name: redhat.vscode-yaml
        Ensure: Present
 …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@HeinvR
Comment options

Answer selected by HeinvR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants