Correct handling of explicit -Since:$false parameter value in Get-Uptime#26141
Conversation
…ducing the bug described in issue PowerShell#25015. Updated the implementation in GetUptime.cs to correct the handling of explicit $false values passed to -Since, making the test pass.
…documenting why it's doing it.
src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: xtqqczze <45661989+xtqqczze@users.noreply.github.com>
test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Uptime.Tests.ps1
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: xtqqczze <45661989+xtqqczze@users.noreply.github.com>
|
@iSazonov Auto-merge isn’t triggering, is this because the PowerShell-Windows-Packaging-CI and PowerShell-CI-linux-packaging checks are still pending? |
|
/azp run PowerShell-Windows-Packaging-CI, PowerShell-CI-linux-packaging |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
@iSazonov I wonder why these checks do not run automatically. |
Related to this, perhaps?
So on the one hand, it's waiting for those pipelines to fire a completion event, but on the other end, the trigger to start the pipelines is filtered out by a path exclusion, and the requirement for successful completion doesn't factor that in so it's just waiting forever? I could be completely off-base, but that does seem to explain the observations. |
|
There are MSFT compliance requirements. |
Fix Get-Uptime's handling of -Since to check the switch's value, rather than only its presence, allowing parameter values to be passed through easily.
PR Summary
This PR adds a test to reproduce the bug described in issue #25015, and then updates the implementation of the
Get-Uptimecmdlet to fix the bug, making the test pass.PR Context
Fixes #25015
Related to #25242
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header