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
Add VerboseAction, DebugAction, ProgressAction, VerboseVariable, DebugVariable, and ProgressVariable common parameters #10238
Add VerboseAction, DebugAction, ProgressAction, VerboseVariable, DebugVariable, and ProgressVariable common parameters #10238
Conversation
src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs
Show resolved
Hide resolved
The alias for Should their respective Action and Variable short forms start with those prefixes? That is, should I'm not sure. Certainly the InformationAction is the only one of the existing aliases that isn't a two-letter alias (and I don't actually know why), so there's good reason to stick with 2-letter initialisms. |
I'm not sure either. Also, used three letters for the progress aliases (
I don't think we want Kidding of course. I'm not attached to anything I chose...I just picked what made sense at the time. |
We should probably also make note that using If we're adding more parameters that by default conflict with that shorthand, we should probably add that as an explicit alias as well. :) |
So here's an idea. These new parameters make the usefulness of The benefit with this approach is to simplify and normalize the common parameters without losing muscle memory and without breaking existing scripts. This generic type would also provide a pattern that would allow for switch replacement in any other command, should the need for that arise. |
src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs
Outdated
Show resolved
Hide resolved
...stem.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs
Show resolved
Hide resolved
src/System.Management.Automation/resources/FormatStrings.Designer.cs
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1
Show resolved
Hide resolved
Co-Authored-By: Ilya <darpa@yandex.ru>
Co-Authored-By: Ilya <darpa@yandex.ru>
Co-Authored-By: Ilya <darpa@yandex.ru>
Co-Authored-By: Ilya <darpa@yandex.ru>
Co-Authored-By: Ilya <darpa@yandex.ru>
…Munro/PowerShell into normalize-common-parameters
…eam.Tests.ps1 Co-Authored-By: Ilya <darpa@yandex.ru>
…Munro/PowerShell into normalize-common-parameters
Here is a screenshot that shows what Aside: That this screenshot demonstrates the problem identified in issue #10236 (many |
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment. |
C'mon, guys. 1.5 years post PR submission, you finally move forward with some action on this, but then your attention wanes at the end when some important questions are put on the table, and then you let it go stale and be closed? @TravisEz13: How was this marked waiting on author when the author (me) had responded with questions back to @PaulHigin? It really is no wonder why I put my I put my interest in pushing PRs into this repo on hold until you all could catch up with the PRs that were already open and the discussions that were already started. I'm not all that surprised that this hasn't happened yet, but what does surprise me is that rather than properly managing what's there, you're allowing it get discarded. Such a waste. |
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
I'm walking away from my open PRs. I'm not really involved in PowerShell much these days. Personally I spend very little time using it, and at this point I don't have the time nor the motivation to deal with PRs submitted over 18 months ago. As a point of feedback, this community is stagnant and unhealthy to participate in. It takes far too much personal effort and lobbying like a politician to get anything moving. Ideas on how to help the community move forward take years, and years, and years to bear any fruit at all. In software development, there is a balance between driving software forward based on internal business and internal/external customer priorities, and driving features and functionality that are quality of life improvements for the community of users using a product. This community has been, and in my mind clearly still is, focused almost exclusively on the former, and only considers the latter when it is of benefit to their goals for the former. It is not balanced at all when it comes to community contributions. Glancing at the history of closed PRs, and who those PRs come from, is clear evidence of this, and it seems obvious where your focus is internally for team member MBOs. |
@KirkMunro, I was going to say that we'll miss your contributions in all forms in this community. But then I realized: there is no we. I share your assessment of what is problematic about this community; let me point to two particularly striking examples that I've personally expended a lot of energy on:
In my perception, these two issues (the specific comments tell the history) exemplify several problematic patterns:
I hope that the many talented people that still make up this community have the stamina to continue to contribute, as things - hopefully - improve, but personally I feel burned out and, save for perhaps filing the occasional bug report prompted by real-life use, I will cease my activities here and in the docs repo. |
PR Summary
VerboseAction
(va
),DebugAction
(da
),ProgressAction
(pra
),VerboseVariable
(vv
),DebugVariable
(dv
), andProgressVariable
(prv
) common parameters.Remove unnecessary restriction around(this has been moved to PR Transition ActionPreference.Suspend enumeration value into a non-supported, reserved state, and remove restriction on using ActionPreference.Ignore in preference variables #10317)ActionPreference.Ignore
(see this discussion in issue 4348).Write-Verbose
andWrite-Warning
such that they simply output their messages if they are invoked with-Debug
. This was missed in PR Debug parameter now sets debugpreference to continue #8195.PSCmdlet.WriteVerbose
andPSCmdlet.WriteWarning
methods. When a cmdlet is invoked without any common parameters, and that cmdlet invokes one of these methods, the cmdlet runtime was supposed to read the corresponding preference value once and then use that value in all subsequent invocations, for performance reasons.WriteVerbose
andWriteWarning
were not properly setting a flag when the value was read, and as a result were reading it again every time. See here for a more detailed discussion about this.PR Context
As per #6702 and some considerations on one of my RFCs, this PR normalizes the common parameter set to allow for better scripter control for any stream in PowerShell.
This is the first step in facilitating easier capturing of stream data for logging purposes.
For the enquiring mind, it is even important to capture progress records, because some scripts are written to show a bunch of progress messages but not much else, and when these are run unattended and fail, it is impossible to know how far along they went before they failed. Capturing progress messages makes that problem go away.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.PSNewCommonParameters