Get-Content -Head and -Tail disallow negative values and cleanup#19715
Get-Content -Head and -Tail disallow negative values and cleanup#19715daxian-dbw merged 15 commits intoPowerShell:masterfrom
Conversation
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
@TravisEz13 Added tests |
|
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? 👍 :ok_hand: :thumbsdown: (Email) |
|
To me this looks like a valid solution , I have added the wg-cmdlets tag because I think the WG should be saying "There are other ways this could be addressed, we like (or don't like) this one." |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
daxian-dbw
left a comment
There was a problem hiding this comment.
It looks good to me overall. However, this is a breaking change, as today a user can specify negative value like Get-Content -Tail -50 or Get-Content -TotalCount -100, and they just mean get all content.
It seems to be a bucket 3 breaking change, but I'd like the Cmdlet WG to make a conclusion.
|
Added to WG agenda |
|
@PowerShell/wg-powershell-cmdlets reviewed this, we agreed that although a breaking change, we think it is a bucket 3 unlikely to impact users change. The main concern is that |
|
@JamesWTruher has some individual PR comments he'll add |
|
@SteveL-MSFT @JamesWTruher I didn't see the new comment above until after I merged the PR ... |
|
Doc issue MicrosoftDocs/PowerShell-Docs#10183 was opened to track removing mention of the default value. |
| @@ -116,15 +79,15 @@ protected override void ProcessRecord() | |||
| { | |||
| // TotalCount and Tail should not be specified at the same time. | |||
| // Throw out terminating error if this is the case. | |||
There was a problem hiding this comment.
this comment seems wrong - it doesn't look like a terminating error
| } | ||
|
|
||
| private bool _totalCountSpecified = false; | ||
| public long TotalCount { get; set; } = -1; |
There was a problem hiding this comment.
hmmm, I wonder if this should be just be long? TotalCount
|
🎉 Handy links: |
PR Summary
TODO:
Add testsPR Context
#19710 @jhoneill @mklement0
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.(which runs in a different PS Host).