Default Sort Property

Using PowerShell, I am trying to understand the concept of a default sort property.

According to this example, for the Sort-Object command:

 PS C:\>get-childitem | sort-object 

Because no properties are specified, Sort-Object uses the default sort property for objects of type file and directory , which is Name .

Is there any way to find out for any given type, which is the default sort property?

+7
powershell
source share
2 answers

In my understanding, the default property is taken from the .ps1XML file for predefined types. But I did not find anything about it in about_Format.PS1XML

+1
source share

For this question, I believe that the default elements are defined here in the path: C: \ Windows \ System32 \ WindowsPowerShell \ v1.0 \ FileSystem.format.ps1xml

0
source share

All Articles