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

include.dsc.resource.json not present in package #641

Closed
3 tasks done
systematicguy opened this issue Feb 13, 2025 · 3 comments · Fixed by #646
Closed
3 tasks done

include.dsc.resource.json not present in package #641

systematicguy opened this issue Feb 13, 2025 · 3 comments · Fixed by #646
Assignees
Labels
Issue-Bug Something isn't working Need-Review
Milestone

Comments

@systematicguy
Copy link

systematicguy commented Feb 13, 2025

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Summary

I wanted to use the Microsoft.DSC/Include resource but it is not there.

I have done some digging and found that https://github.com/PowerShell/DSC/blob/39633899ebdc40fd80b432fa69b0c710e8c00812/build.ps1 describes some files in $filesForWindowsPackage, e.g. 'assertion.dsc.resource.json', but it seems that 'include.dsc.resource.json' was never part of it (according to the git history of it).

I simply downloaded https://github.com/PowerShell/DSC/releases/download/v3.0.0-rc.1/DSC-3.0.0-rc.1-x86_64-pc-windows-msvc.zip, did the unblocking magic and put it onto my path, and other resources do work.

I do see that the tests are there, e.g. https://github.com/PowerShell/DSC/blob/39633899ebdc40fd80b432fa69b0c710e8c00812/dsc/tests/dsc_include.tests.ps1 so it might be a rookie mistake and I just need to install something extra.

Could it be that this was never caught due to everyone having the repo's dsc folder on their path when running the tests?
Or am I missing something obvious?

On another note, the followings (present in the docs) are also missing from my dsc resource list output (besides Microsoft.DSC/Include):

  • Microsoft/Process
  • Microsoft.DSC/Parallel

Steps to reproduce

# example.dsc.config.yaml
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
metadata:
  Microsoft.DSC:
    securityContext: Elevated
resources:
  - name: include base64
    type: Microsoft.DSC/Includes
    properties:
      configurationFile: choco-base64-example.dsc.config.yaml # this exists and works on its own

dsc config set -f example.dsc.config.yaml

Expected behavior

the configuration works

Actual behavior

Performing a `dsc resource list`, there is no `Microsoft.DSC/Include`, only Group, Assertion and Powershell.
Looking at the docs and the examples, this should be available: https://learn.microsoft.com/en-us/powershell/dsc/reference/cli/resource/list?view=dsc-3.0

`dsc config set -f example.dsc.config.yaml` produces
`ERROR Error: Resource not found: Microsoft.DSC/Include`

Error details

ERROR Error: Resource not found: Microsoft.DSC/Include

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.6
PSEdition                      Core
GitCommitId                    7.4.6
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

3.0.0-rc.1

Visuals

No response

Workaround

I have copied https://github.com/PowerShell/DSC/blob/39633899ebdc40fd80b432fa69b0c710e8c00812/dsc/include.dsc.resource.json into the folder I have unarchived the dsc release and it works.

@systematicguy systematicguy added Issue-Bug Something isn't working Need-Review labels Feb 13, 2025
@systematicguy
Copy link
Author

Btw I would be happy to contribute this if it is really not much more than some missing lines in build.ps1

@Gijsreyn
Copy link
Contributor

I just tried the same to test out the new Include functionality:

Image

I guess I've always grabbed the resource manifest from GitHub.

@SteveL-MSFT
Copy link
Member

@systematicguy Thanks for reporting this! Doing an easy for for now, longer term fix is to run the tests against the built package, but then need a way to get the test resources while ensuring they aren't accidentally included into a release package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Need-Review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants