Bug: UDTableColumn -DefaultSortColumn not working

Product: PowerShell Universal
Version: 1.5.16

As described in the title the DefaultSortColumn parameter does not work

In addition I realized that when sorting for a column instead of switching let’s say from A-Z and then Z-A, there’s a third sorting that is performed which is non-sense. It’s either A-Z nor Z-A… When you then click the column once more, it starts again with sorting correctly:
A-Z => Z-A => nonsense (unsorted), … etc.

=> This last issue is also noticeable on 1.6.x


Are you using -LoadData or the -Data parameter?

As for the unsorted state, we can disable that via the library we are using. It seems they off a disableSortRemove option to prevent this from happening: API Reference: useSortBy | React Table | TanStack

Hey @adam

I’m using -Data as shown in your docs:

Why, shall I use -LoadData? And what’s the difference in that case?

With regards to your final statement:
Do I understand it correctly that the library offers a function but you’ll need to implement it into PSU?
If that’s the case, first of all thanks a lot for doing that! I think it would absolutely make sense. Additionally the MultiSort would also make a lot of sense to me… Like the sorting function in Excel. where you basically specify the sortBy column order:
For example: First = Company, Second = Last Name

… just in case you want to make UDTable even more “pro” :smiley:

THANKS A LOT again for all your efforts and considerations of our user feedbacks! Top!

Have a very good weekend!


When you use -LoadData, is for server-side data loading and we process things a bit differently in that case. I just wanted to understand how to approach the issue.

As for the sorting, we do need to implement the functionality in PSU that the library provides. I think the library offers multi-sort as well so I’ll open an issue for that too to see if we can get that going for you.


Thank you soooo much! Really much appreciated! :smiley: :+1:

Enjoy your weekend!