Allow combining of -Skip and -SkipLast parameters in Select-Object cmdlet. (#18849)

* Added SkipLast parameter set to Skip parameter and updated tests

* Using Should -BeExactly with string

* Update test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Object.Tests.ps1

---------

Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
Co-authored-by: Travis Plunk <github@ez13.net>
This commit is contained in:
authored and GitHub committed 2023-05-02 13:07:32 -07:00
1 parent 8135167827
commit 07e041fe10
2 files changed
+25 -1

No files matched your search

@@ -144,10 +144,11 @@ namespace Microsoft.PowerShell.Commands
private bool _firstOrLastSpecified;
/// <summary>
/// Skips the specified number of items from top when used with First, from end when used with Last.
/// Skips the specified number of items from top when used with First, from end when used with Last or SkipLast.
/// </summary>
/// <value></value>
[Parameter(ParameterSetName = "DefaultParameter")]
[Parameter(ParameterSetName = "SkipLastParameter")]
[ValidateRange(0, int.MaxValue)]
public int Skip { get; set; }