Skip to content

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

Closed
@systematicguy

Description

@systematicguy

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions