PowerShell / PowerShell/DSC

Passing resource JSON for invocation no longer works

Open
#449 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug Need-Review
Dominant language
Rust
Stars
523
Forks
75
Avg merge
3d 16h
Merged PRs (30d)
24

Description

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

dsc resource get -r is expected to accept a wildcard, name of resource, or the resource JSON (to avoid a search). The latter has been broken.

Steps to reproduce
$osinfo = dsc resource list Microsoft/OSInfo
dsc resource get -r $osinfo
Expected behavior
Since `$osinfo` is a JSON representation of a resource, it has all the info about the resource so discovery should not occur and `dsc` should try to directly perform a `get`
Actual behavior
`dsc` is using the JSON as a search string
Error details

No response

Environment data
Name                           Value
----                           -----
PSVersion                      7.5.0-preview.1
PSEdition                      Core
GitCommitId                    7.5.0-preview.1-103-gda1ca4a7266e2c9e43f96a38aeea8092ace71cca
OS                             Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Version

dsc 3.0.0-preview.8

Visuals

No response

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 at the dsc resource get -r argument handling and reproduce the issue with the PowerShell commands in the report. Trace how the JSON from dsc resource list Microsoft/OSInfo is classified, then verify that passing it avoids discovery and performs the resource get directly.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.