Hi, does anybody know how to pass a ShouldProcess response to nested cmdlet and function calls? Do cmdlets handle this already? Can a function be written in such a way to accept a "yes to all" from the function calling it?
If I know the function is nested, I could use the parent scope.
(Get-Variable pscmdlet -Scope 1).Value.ShouldProcess(...)
However, this assumes the function will always be nested which I don't want to do. I suppose I could try to test if the function is nested first. Use the parent scope if it exists, otherwise use the local scope?
Is there a standard/correct way to handle this?
Thanks.
Randy in Marin