Last active
January 3, 2023 04:34
-
-
Save techthoughts2/31e857594e541be9fa3bc72375ef4f6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-shouldprocess?view=powershell-7.3 | |
[CmdletBinding(ConfirmImpact = 'Low', | |
SupportsShouldProcess = $true)] | |
# $PSCmdlet.ShouldProcess('TARGET') | |
# $PSCmdlet.ShouldProcess('TARGET','OPERATION') | |
# $PSCmdlet.ShouldProcess('MESSAGE','TARGET','OPERATION') | |
# -Confirm --> $ConfirmPreference = 'Low' | |
# ShouldProcess intercepts WhatIf* --> no need to pass it on | |
if ($Force -or $PSCmdlet.ShouldProcess($DestinationPath, "Scaffolding module project with: $($ModuleParameters | Out-String)")) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment