-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
See also: #13769
Summary of the new feature/enhancement
Select-Object's -Skip and -SkipLast parameters are currently in separate parameter sets, which syntactically prevents using them together.
However, there seems to be no good conceptual reason to prevent that, as it is conceivable that you may want to skip elements at both the beginning and end:
# WISHFUL THINKING
1..5 | Select-Object -Skip 1 -SkipLast 1
2
3
4-
-Skipshould be applied first. -
-SkipLastmust remain mutually exclusive with-Firstand-Last(which themselves can be combined with-Skip).
If the suggestion in #11750 is implemented, the same combination of parameters should also be allowed with Get-Content.
SeeminglyScience, scotthardwick, p0W3RH311, vexx32, jackdcasey and 3 morescriptingstudio
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module