microsoft / microsoft/winget-cli

Enable WSL fails during configuration

Open
#3,348 4 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Brief description of your issue

@meikTranel reported in https://github.com/microsoft/winget-cli/discussions/3346

# Enable WSL
   - resource: PSDscResources/WindowsOptionalFeature
     directives:
       description: Enable WSL
     settings:
       Name: Microsoft-Windows-Subsystem-Linux

image

WSL Enabling fails because apparently winget configure runs pwsh.exe which cannot run PS Code regarding windows optional feature management.

Steps to reproduce

Build a configuration with the above resource.

Expected behavior

Windows Subsystem for Linux will be anabled

Actual behavior

An error reporting "Class not registered".

Environment
Not reported.

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 by reproducing the configuration using the PSDscResources/WindowsOptionalFeature resource for Microsoft-Windows-Subsystem-Linux, then inspect how winget configure invokes pwsh.exe for this resource. Compare the failing Class not registered error with the expected WSL enablement; done means the configuration completes successfully and enables WSL.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.