Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Select-Object: Allow combining -Skip and -SkipLast #11752

Copy link
Copy link
@mklement0

Description

@mklement0
Issue body actions

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
  • -Skip should be applied first.

  • -SkipLast must remain mutually exclusive with -First and -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.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.