dsc set command fails when using powershellgroup resources with json error
Nobody has claimed this yet.
- 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.
Steps to reproduce
When using dsc config set for a test powershellgroup resource, I get an error Operation: Failed to parse json from get pwsh|PSDscResources/MSFT_WindowsFeature. However, it then returns a valid json object so it is unclear why it is unable to parse the output.
Sample config code:
`# example.dsc.config.yaml
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
resources:
- name: powershell-dsc-resources
type: DSC/PowerShellGroup
properties:
resources:- name: DNS
type: PSDscResources/MSFT_WindowsFeature
properties:
Name: DNS
Ensure: Present
`
- name: DNS
And example output:
{
"IncludeAllSubFeature": false,
"DisplayName": "DNS Server",
"Name": "DNS",
"Ensure": "Absent"
}
When running dsc set the additional error details is Error: JSON: expected value at line 1 column 1
Expected behavior
dsc would set the configuration to match the yaml config file
Actual behavior
Error - Error: JSON: expected value at line 1 column 1
Error details
Error: JSON: expected value at line 1 column 1
Environment data
Name Value
---- -----
PSVersion 7.3.9
PSEdition Core
GitCommitId 7.3.9
OS Microsoft Windows 10.0.20348
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version
7.3.9
Visuals
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce dsc config set with the provided PowerShellGroup YAML and inspect the JSON parsing around the get pwsh|PSDscResources/MSFT_WindowsFeature operation. The work is done when the sample configuration applies successfully without the JSON: expected value at line 1 column 1 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100