PowerShell / PowerShell/PSResourceGet

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

Aperta
#2,050 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature_request Needs-Triage
Lingua principale
C#
Stelle
576
Fork
114
Merge medio
1g 2h
PR unite (30g)
7

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
powershell
Ambito
cli, tooling
Tipo di issue
Refactoring
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.