PowerShell / PowerShell/PSResourceGet
(dsc): `PSResourceList` manifest migration for deprecated `whatIf` to `set.whatIfArg`
Nessuno ha ancora preso questa issue.
- 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
whatIfblock with"whatIfArg": "-WhatIf"insideset. whatIfArgis appended after the existingargs, which does not work with-Command "...". Switchsetto-File ./psresourceget.ps1 -ResourceType psresourcelist -Operation setso the appended-WhatIfbinds to the script's[switch]$WhatIf. Verified locally thatpwsh -Filewith stdin input works for this script.- Bump
$schemaon both manifests to a version that includeswhatIfArgand set the minimum supported DSC version to 3.2.0 in the README. - While in the manifests, the
Repositorymanifest's-Commandinvocations should also gain; exit $LASTEXITCODEor move to-File
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- 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