microsoft / microsoft/winget-cli

Unable to install vscode and 7zip using WinGet configure

Open
#3,368 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Command-Configure Issue-Bug PowerShell
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

When I run winget configure on my yaml file, I get the message "The module for the configuration unit is available in multiple locations within the same version." I've also had trouble finding the correct resource name within given DSC modules, is there an easy way to do this that I am unaware of? I think I'm using the correct resource to get vscode and 7zip.

# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
  resources:
    - resource: WinGetPackage
      id: vsCode
      directives:
        module: Microsoft.WinGet.DSC
        description: 'Install Microsoft Visual Studio Code'
        allowPrerelease: true
      settings:
        id: Microsoft.VisualStudioCode
        source: winget
    - resource: Microsoft.WinGet.DSC/WinGetPackage
      id: 7zip
      directives:
        description: Install 7Zip
        allowPrerelease: true
      settings:
        id: 7zip.7zip
        source: winget
  configurationVersion: 0.2.0

wingetError

Steps to reproduce

Run winget configure with my given yaml code

Expected behavior

I expected both vscode and 7zip to install as expected

Actual behavior

An error/warning is given

Environment
Windows Package Manager (Preview) v1.6.1573-preview
Windows: Windows.Desktop v10.0.19044.1348
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.1573.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied YAML and the winget configure command, focusing on the two WinGetPackage resource declarations and their module directives. Reproduce the reported multiple-location error with the listed WinGet and Windows environment; done means the configuration installs both VS Code and 7-Zip without the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.