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
Do not require activity when creating a completed progress record #18474
base: master
Are you sure you want to change the base?
Do not require activity when creating a completed progress record #18474
Conversation
|
It doesn't seem possible to fix this with parametersets without making a breaking change. It seems like the only option left is to keep the current parameterset and simply make |
|
I'll queue this up for discussion on Cmdlets WG |
|
This script example seems to work? [cmdletbinding(DefaultParameterSetName='two')]
param(
[parameter(ParameterSetName='one', mandatory=$true)]
[parameter(ParameterSetName='two', mandatory=$false)]
[string]$activity,
[parameter(ParameterSetName='two')]
[switch]$completed
)
$activity
$completed |
|
That's not an accurate example though. This example is more accurate: but by making parameter set "two" the default set and the "completed" switch optional we allow people to call it without any parameters at all: |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
@PowerShell/wg-powershell-cmdlets reviewed this. We agreed to make |
…and set a default value instead.
src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs
Outdated
Show resolved
Hide resolved
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs
Show resolved
Hide resolved
@SteveL-MSFT Did you discuss Clear-Progress instead of the change? |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
@iSazonov no, |
|
@SteveL-MSFT @iSazonov If you decide to go that route I think a better verb choice would be |
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? |


PR Summary
Fixes #15252
Allows you to complete progress records with
Write-Progresswithout specifying an activity.This is done by using a predefined string in the activity for
Completerecords because the API expects a non-empty string and updating the API would cause issues in remoting scenarios with a different PowerShell host.PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.Write-Progressthat theActivityparameter is optional MicrosoftDocs/PowerShell-Docs#9864(which runs in a different PS Host).