You are here: > PowerShell > PowerShell 1.0 > Sort-Object
ActiveXperts Network Monitor 2015 proactively manages network servers, devices, databases and more.

Sort-Object - PowerShell 1.0

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.


Back up your Hyper-V VMs Easy & Fast. 100% built for Hyper-V. Free for 2 VMs, forever.


-property Object
       A property or properties to use when sorting.

   -inputObject psobject
       The objects to be sorted. (may be piped)

   -culture string
       The cultural/country configuration to use when sorting.

       Sort UPPER and lower case letters separately.

       Return only the unique values.

       Sort in descending order.

       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutVariable.

List the files in the current directory and sort using the default order (alphabetical by Name):

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

List the files in the current directory and sort by date/time:

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

List the files in the current directory and sort in descending order by the time span between CreationTime and LastWriteTime:

PS C:\>get-childitem *.* | sort-object @{Expression={$_.LastWriteTime-$_.CreationTime}; Ascending=$false} | select-object LastWriteTime, CreationTime