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 ','
We already have an
-Indexparameter 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.
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.
This makes conversion from csv an exercise in coding.
With my suggested parameter, it would be as simple as