-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
We already have an -Index parameter that select the specific indices we provide.
This would be the opposite, allowing us to specify the indices we want to exclude from the output.
PS> 1..5 | Select-Object -SkipIndex 2,3
1
2
5
A real world example:
Disk Usage (du.exe) outputs a weird line "Processing..." in the middle of the output when asking for CSV output AND the output is redirected.
$a = du -q -nobanner -c .
$a
Path,CurrentFileCount,CurrentFileSize,FileCount,DirectoryCount,DirectorySize,DirectorySizeOnDisk
Processing...
"C:\Users\sgustafsson\vimfiles",2,3427,13,8,31129,94496
This makes conversion from csv an exercise in coding.
With my suggested parameter, it would be as simple as
du -q -nobanner -c . | Select-Object -SkipIndex 1,2 | ConvertFrom-Csv -delimiter ','
markekraus, mklement0, FireInWinter and kborowinski
Metadata
Metadata
Assignees
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module