RETRIEVE Every 10th file in a folder.

%3CLINGO-SUB%20id%3D%22lingo-sub-2451598%22%20slang%3D%22en-US%22%3ERETRIEVE%20Every%2010th%20file%20in%20a%20folder.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2451598%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20folder%20with%20100%20files.%20How%20can%20I%20get%20file%2010%2C%2020%2C%2030%2C%2040%2C%2050%2C%2060%20........100.%26nbsp%3B%20Every%2010th%20file%20in%20the%20folder.%3C%2FP%3E%3CP%3EI%20want%20to%20be%20able%20to%20switch%20to%20every%20X%20file%20with%20X%20as%20an%20integer%20from%201%20to%2010.%26nbsp%3B%20%26nbsp%3B%20Thank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2451598%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowershell%20File%20retrieval%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2455378%22%20slang%3D%22en-US%22%3ERe%3A%20RETRIEVE%20Every%2010th%20file%20in%20a%20folder.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2455378%22%20slang%3D%22en-US%22%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1079859%22%20target%3D%22_blank%22%3E%40dave36333%3C%2FA%3E%20%2C%3CBR%20%2F%3E%3CBR%20%2F%3Ethis%20is%20a%20very%20quick%20and%20dirty%20option.%3CBR%20%2F%3E%3CBR%20%2F%3EIs%20this%20quick%20enough%20for%20you%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%24Test2%20%3D%20dir%20C%3A%5CUsers%5CFlorian%5CDesktop%5C%3CBR%20%2F%3E%24Test2%5B9%2C19%2C29%2C39%2C49%2C59%2C69%2C79%2C89%2C99%5D%3CBR%20%2F%3E%3CBR%20%2F%3E(Don't%20forget%20the%20count%20starts%20at%200)%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20regards%2C%3CBR%20%2F%3ESchnittlauch%3CBR%20%2F%3E%3CBR%20%2F%3E%22First%2C%20No%20system%20is%20safe.%20Second%2C%20Aim%20for%20the%20impossible.%20Third%2C%20no%20Backup%2C%20no%20Mercy%22%20-%20Schnittlauch%3CBR%20%2F%3E%3CBR%20%2F%3EMy%20answer%20helped%20you%3F%20Don't%20forget%20to%20leave%20a%20like.%20Also%20mark%20the%20answer%20as%20solved%20when%20your%20problem%20is%20solved.%20%3A)%3C%2Fimg%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I have a folder with 100 files. How can I get file 10, 20, 30, 40, 50, 60 ........100.  Every 10th file in the folder.

I want to be able to switch to every X file with X as an integer from 1 to 10.    Thank you

1 Reply
Hi @dave36333 ,

this is a very quick and dirty option.

Is this quick enough for you?

$Test2 = dir C:\Users\Florian\Desktop\
$Test2[9,19,29,39,49,59,69,79,89,99]

(Don't forget the count starts at 0)

Best regards,
Schnittlauch

"First, No system is safe. Second, Aim for the impossible. Third, no Backup, no Mercy" - Schnittlauch

My answer helped you? Don't forget to leave a like. Also mark the answer as solved when your problem is solved. :)