You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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 Stack<T> instead of doing it with recursion. Older versions of this function were using recursion but it was changed for efficiency. If you find out a way please let me know and I'll try to implement it.
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.
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: