Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSComponents not working with winget configure #17

Open
flowcoder1 opened this issue Nov 21, 2023 · 4 comments
Open

VSComponents not working with winget configure #17

flowcoder1 opened this issue Nov 21, 2023 · 4 comments

Comments

@flowcoder1
Copy link

I can't get winget configure to install Visual Studio components with the current version (https://www.powershellgallery.com/packages/Microsoft.VisualStudio.DSC/1.0.18-beta). Once I do a Install-Module -Name Microsoft.VisualStudio.DSC -RequiredVersion 1.0.15-beta -AllowPrerelease then (Get-DscResource VSComponents).Properties works and so does the winget configuration file:

# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
# Reference: https://github.com/microsoft/terminal#prerequisites
properties:
  assertions:
    - resource: Microsoft.Windows.Developer/OsVersion
      directives:
        description: Verify min OS version requirement
        allowPrerelease: true
      settings:
        MinVersion: '10.0.22000'
  resources:
    - resource: Microsoft.Windows.Developer/DeveloperMode
      id: DeveloperMode
      directives:
        description: Enable Developer Mode
        allowPrerelease: true
      settings:
        Ensure: Present
    - resource: Microsoft.WinGet.DSC/WinGetPackage
      id: vsPackage
      directives:
        description: Install Visual Studio 2022 (any edition is OK)
        allowPrerelease: true
      settings:
        id: Microsoft.VisualStudio.2022.Community
        source: winget
    - resource: Microsoft.VisualStudio.DSC/VSComponents
      dependsOn:
        - vsPackage
      directives:
        description: Install required VS workloads
        allowPrerelease: true
      settings:
        productId: Microsoft.VisualStudio.Product.Community
        channelId: VisualStudio.17.Release        
        components:
          - Microsoft.VisualStudio.Workload.ManagedDesktop
          - Microsoft.VisualStudio.Workload.Universal
  configurationVersion: 0.2.0

See microsoft/winget-cli#3914 for discussion.

@bavulapati
Copy link

We are also facing this issue.

@msftrubengu
Copy link
Contributor

The module can't be imported.

PS D:\Dev> import-module microsoft.visualstudio.dsc
ParserError: Missing ')' in function parameter list.
Import-Module: The module to process 'Microsoft.VisualStudio.DSC.psm1', listed in field 'ModuleToProcess/RootModule' of module manifest 'C:\Users\rubengu\Documents\PowerShell\Modules\microsoft.visualstudio.dsc\1.0.18\microsoft.visualstudio.dsc.psd1' was not processed because no valid module was found in any module directory.

There's a comma missing here

@denelon
Copy link

denelon commented Dec 1, 2023

As an undocumented workaround, you can add "maxVersion: "1.0.15" to the WinGet configuration under directives.

      directives:
        description: Install required VS workloads
        maxVersion: "1.0.15"
        allowPrerelease: true

@denelon
Copy link

denelon commented Jan 4, 2024

@flowcoder1 it looks like the PR with the fix was merged, and a new version of the module was published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants