Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate execution preferences beyond script module scope #221

Open
wants to merge 1 commit into
base: master
from

Conversation

@KirkMunro
Copy link
Contributor

KirkMunro commented Aug 16, 2019

This RFC was originally proposed as part of a collection of RFCs in PR #187. I am separating those RFCs into separate PRs to better adhere to the RFC process.

@KevinMarquette

This comment has been minimized.

Copy link

KevinMarquette commented Feb 29, 2020

I am surprised that this has been broken for as long as hit has. I find that this issue makes -WhatIf a very dangerous parameter. A module author should not need to be aware of the fact that they command they are calling is in a binary module or a script module. But to correctly implement SupportsShouldProcess, they absolutely must know when they are making calls to a script module so they know to call it with -WhatIf:$WhatIf or wrap it behind a call to $PSCmdlet.ShouldProcess.

The real danger is most people don't realize it works this way.

@vexx32

This comment has been minimized.

Copy link
Contributor

vexx32 commented Feb 29, 2020

Agreed. This issue renders every common parameter effectively unusable for script module authors whenever they call commands external to their modules because most authors will not understand why some commands work without issue and others completely ignore the requested preference.

I can only hope we can get it approved for a fix as soon as possible.

@bergmeister

This comment has been minimized.

Copy link

bergmeister commented Mar 6, 2020

Stumbled across this today as well when I refactored code into a common script module where as a result of that the $WhatIfPreference was not propagated any more to the function being called. This is a serious bug IMHO and I don't see how fixing this would break other people's code, even if someone relied on $WhatIfPreference actually not being propagated then it should be an easy fix anyway.

@vexx32

This comment has been minimized.

Copy link
Contributor

vexx32 commented Mar 6, 2020

@joeyaiello @SteveL-MSFT is this one one your guys' radar at all? 💖

@radinmoradi

This comment has been minimized.

Copy link

radinmoradi commented Mar 25, 2020

@radinmoradi

This comment has been minimized.

Copy link

radinmoradi commented Mar 25, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.