microsoft / microsoft/winget-cli

File resource fails during configuration

Open
#3,349 6 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Command-Configure 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

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

  - resource: File
    directives:
      description: Use gitconfig from repo
    dependsOn:
      - git
    settings:
      SourcePath: ${WinGetConfigRoot}\.gitconfig
      DestinationPath: $env:UserProfile\.gitconfig

image

Copying files using the File resource fails because apparently it needs windows management dlls which cannot be loaded in ps core also.

Steps to reproduce

Build a configuration with the above resources.

Expected behavior

File resource would be copied to the destination path.

Actual behavior

An error reporting "The resource 'File' implemented as 'Binary' is not supported by Invoke-DscResource.

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

Build a configuration using the listed WinGetPackage and File resources, then trace how the File resource is handled through Invoke-DscResource in PowerShell Core. Focus on why the Binary implementation cannot load or run in this configuration. Done means the .gitconfig is copied from SourcePath to DestinationPath without the reported unsupported-resource error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
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.