Error while testing the `winps_script.dsc.yaml` example
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.
Summary
I am getting an error "You cannot call a method on a null-valued express" when trying the winps_script.dsc.yaml example with the stable release, or a manifest description: Error warning and error with the preview release. If I set the Process ExecutionPolicy to Bypass, the preview release gives the same error as the stable release.
I'm including trace outputs from both the stable and preview releases of the CLI to show the differences in impact the Process ExecutionPolicy has on the two different releases. I installed them with winget install --id Microsoft.DSC -e and winget install --id Microsoft.DSC.Preview -e (one at a time with the other uninstalled), so those are the names I use in the filenames of the attached trace output files. In each case, I had the CurrentUser and LocalMachine ExecutionPolicy set to Bypass (temporarily) and either set the Process ExecutionPolicy to Undefined or Bypass to show the impact that has on both releases.
Each trace output was generated with this command: dsc -l trace config test --file .\winps_script.dsc.yaml.
Microsoft.DSC.Preview-Bypass.txt
Microsoft.DSC.Preview-Undefined.txt
Microsoft.DSC-Bypass.txt
Microsoft.DSC-Undefined.txt
Steps to reproduce
- Save a local copy of the example script.
- Call
testor any of the other methods on it. e.g.dsc config test --file .\winps_script.dsc.yaml
Expected behavior
No errors
Actual behavior
An error: `You cannot call a method on a null-valued expression.`
Error details
2025-05-17T18:30:40.366999Z ERROR PID 2420: Exception: You cannot call a method on a null-valued expression.
2025-05-17T18:30:40.386900Z ERROR Command: Resource 'powershell' [exit code 1] manifest description: Error
Environment data
Name Value
---- -----
PSVersion 7.5.1
PSEdition Core
GitCommitId 7.5.1
OS Microsoft Windows 10.0.26100
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version
dsc 3.1.0-preview.1 (or dsc 3.0.2)
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
Start with the winps_script.dsc.yaml example and reproduce the failure using dsc -l trace config test --file .\winps_script.dsc.yaml under the stable and preview releases. Compare the attached traces with the PowerShell execution-policy settings and verify the example completes without the null-valued-expression error or manifest description warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, yaml
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100