-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort by ascending values #9
Comments
Hi @jlnrrg thanks for opening this issue, I'm aware of it but I'm not sure if there is a way around it. This is a consequence of using a |
Now that you've rewritten in C#, shouldn't it be easy to sort it ascending by default now? I'm guessing here but wondered if you thought about it. The link to the stack code is broken now by the way. |
Hi @krzydoug, it's not as easy as it may seem, each sub tree needs to be sorted individually (all files within a folder) and then each parent tree (all folders). I don't see a way to make it happen easily and also, even then, making it work would have a high performance hit but if you want to give it a go, the method that traverses the folders is here: https://github.com/santisq/PSTree/blob/main/src/PSTree/Commands/GetPSTreeCommand.cs#L143-L249 |
I noticed that the default output is sorted descending.
It has been a long time since I last worked with PS, so I am not aware how to resort the tree later on.
If you know I would be happy for advice, otherwise I would propose a sorting flag, or to make the default sort ascending, as that would mimik the default windows explorer sorting behaviour.
Cmd I've run:
Get-PSTree -Directory
The text was updated successfully, but these errors were encountered: