No, Session.ListDirectory is the right way. Just sort the result of the method. No need for Session.Output.
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.
Sorry I do not understand. Why would you sort contents of Session.Output? You can sort RemoteFileInfoCollection (RemoteDirectoryInfo.Files) instead.
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