Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ConfirmImpact: Correctly Report impact level when SupportsShouldProcess = false #8209
This change reflects the cmdlets' actual defined attributes when querying a cmdlet's or function's defined ConfirmImpact value. Tests have been updated to reflect the true values now reported.
Prior to this PR they would report as having "Medium" impact when querying the attribute's set ConfirmImpact as that is the default value, despite not implementing ShouldProcess in the first place nor declaring support for it.
This is primarily a change in how this value reports when
All changes from
It is my hope that by making plain the true effective implementations of ShouldProcess support in cmdlets and the effective ConfirmImpact values here that we can have a concrete reference point to look at and check which cmdlets should have ShouldProcess support and do not, or have an inappropriate ConfirmImpact value.
Per @PowerShell/powershell-committee's recommendation, the following cmdlets have additionally had their
Note: The above change with the
The full list of commands loaded in a default session and their current ConfirmImpact ratings are detailed in these gists:
Note: Currently failing test is due to test that expects ConfirmImpact to be reported for a cmdlet that is defined with
@iSazonov I'm having difficulty testing this effectively. It seems
Would this have to be moved to an xunit test, or do we have some other possible way to test for these? See #8214
I noted that while testing these changes the test I had previously constructed didn't provide particularly useful output, and changed it to also
I tested this locally and it passes, so hopefully the CI should pass as well. I noted as I went through there were still a few commands that do have a properly-implemented
There were also a couple as I ran through that I side-eyed and went "really, that didn't implement ShouldProcess?" so there may be a few of those kicking about too. Hopefully most of those ones should be pretty obvious in the diff display, though.
I don't think this change affects any documentation, unless the handful of cmdlets that did get changes in their ConfirmImpact mention the impact level specifically.
The rest of this change is likely to be largely invisible unless you're specifically looking for this data. PR description is OK, I think it's alright to leave the comments about possible follow up in case someone needs to refer to them. The description of the change remains accurate.