(dsc): `PSResourceList` manifest migration for deprecated `whatIf` to `set.whatIfArg`

Open
#2,050 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
powershell
Domain
cli, tooling

Research direction

Locate psresourcelist.dsc.resource.json, the Repository manifest, and the README. Compare the existing set and what-if commands with the DSC 3.2.0 whatIfArg schema, then validate the -File invocation with stdin input in pwsh. Done means both manifests use the supported schema and exit handling, and the README states the minimum DSC version.

Written by the indexing model from the issue text.

Description

feature_request Needs-Triage
Summary of the new feature / enhancement

psresourcelist.dsc.resource.json implements what-if through the top-level whatIf manifest operation. DSC deprecated that operation in 3.2.0 in favour of set.whatIfArg, where the engine appends an argument to the normal set command instead of running a separate command. Staying on whatIf means a deprecation warning today and a break when the property is removed.

Current manifest:

"whatIf": {
  "executable": "pwsh",
  "args": [ "-NoLogo", "-NonInteractive", "-NoProfile", "-ExecutionPolicy", "Bypass", "-Command",
            "$Input | ./psresourceget.ps1 -resourcetype 'psresourcelist' -operation set -WhatIf; exit $LASTEXITCODE" ],
  "input": "stdin",
  "return": "state"
}
Proposed technical implementation details (optional)
  • Replace the whatIf block with "whatIfArg": "-WhatIf" inside set.
  • whatIfArg is appended after the existing args, which does not work with -Command "...". Switch set to -File ./psresourceget.ps1 -ResourceType psresourcelist -Operation set so the appended -WhatIf binds to the script's [switch]$WhatIf. Verified locally that pwsh -File with stdin input works for this script.
  • Bump $schema on both manifests to a version that includes whatIfArg and set the minimum supported DSC version to 3.2.0 in the README.
  • While in the manifests, the Repository manifest's -Command invocations should also gain ; exit $LASTEXITCODE or move to -File
Dominant language
C#
Stars
576
Forks
114
Avg merge
1d 2h
Merged PRs (30d)
7

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.

More from PowerShell/PSResourceGet

All issues in PowerShell/PSResourceGet

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.