Skip to content

docs(powershell): require ShouldProcess/-WhatIf instead of custom dry-run#187

Merged
MarkMichaelis merged 1 commit into
mainfrom
docs/186-shouldprocess-guideline
Jun 6, 2026
Merged

docs(powershell): require ShouldProcess/-WhatIf instead of custom dry-run#187
MarkMichaelis merged 1 commit into
mainfrom
docs/186-shouldprocess-guideline

Conversation

@MarkMichaelis

Copy link
Copy Markdown
Contributor

Summary

Adds a State-Changing Functions section to the PowerShell instructions: mutating functions/scripts should use the standard SupportsShouldProcess pattern ([CmdletBinding(SupportsShouldProcess)] + .ShouldProcess(...)) so callers get built-in -WhatIf and -Confirm, rather than a hand-rolled -DryRun switch. -WhatIf is the idiomatic PowerShell dry run.

Generic guidance only -- no project-specific content (upstream-managed instructions file).

Closes #186

Add a "State-Changing Functions" section to the PowerShell instructions:
mutating functions/scripts should implement SupportsShouldProcess and guard
actions with $PSCmdlet.ShouldProcess(...), giving callers built-in -WhatIf
and -Confirm. Prefer this over a bespoke -DryRun switch, since -WhatIf is the
idiomatic PowerShell dry run.

Closes #186

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MarkMichaelis MarkMichaelis merged commit 985bef5 into main Jun 6, 2026
2 checks passed
@MarkMichaelis MarkMichaelis deleted the docs/186-shouldprocess-guideline branch June 6, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(powershell): require ShouldProcess/-WhatIf instead of custom dry-run

1 participant