-whatif and -confirm "SafetySwitches" #2548
Unanswered
doctorscripto
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Something that be a wonderful addition to any Cmdlets that do more than "Read" (Example, Set, Update etc) would be the addition of support for the -whatif and -confirm switches.
I can do it in PowerShell (Advanced Functions) and really it's a minor block that wraps around the code
I found an example in C# if anybody is interested
https://www.red-gate.com/simple-talk/development/dotnet-development/using-c-to-create-powershell-cmdlets-beyond-the-basics/
It provides a simple to implement safety gate between users and the data when using PowerShell cmdlets. I mentioned it because I was about to use a -whatif on the Set-PNPList and noticed that neither -whatif nor -confirm were there. Most Cmdlets in PowerShell that change something will have at least one or both of these parameters.
Beta Was this translation helpful? Give feedback.
All reactions