sorting output of ListDirectory method

Advertisement

lduczmal
Joined:
Posts:
7

sorting output of ListDirectory method

Hi!
Is it possible to sort output ListDirectory() method?
Of course I can do it by manually parsing content of $session.output property, but maybe there is some easiest way... for instance by some optional argument which I pass to listdirectory() method?
Best regards
Luki

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: sorting output of ListDirectory method

Sorry I do not understand. Why would you sort contents of Session.Output? You can sort RemoteFileInfoCollection (RemoteDirectoryInfo.Files) instead.

Reply with quote

lduczmal
Joined:
Posts:
7

In my script I use ListDirectory() method to obtain list of files on server, but it looks from your answer that there is better way for it. I check it. Thank you for hint.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

No, Session.ListDirectory is the right way. Just sort the result of the method. No need for Session.Output.

Reply with quote

Advertisement

You can post new topics in this forum