DAY-7: POWERSHELL OBJECT'S
Sorting Objects Most PowerShell Cmdlets produce objects in a deterministic fashion, which means that they tend to produce objects in the same order every time you run the command. Both service and process, for example, are listed in alphabetical order by name. What if we want to change that. For example, we want to display a list of processes, which is the biggest consumers of Virtual Memory (VM) at the top of the list. For this, we need to re-order that list of objects based on VM property. PowerShell provides a simple Cmdlet, Sort-Object, which does exactly that: Get-Process | Sort-Object -property VM We're hoping that you'll follow this blog and try to run all the given commands to test it yourself. That command isn't exactly what we wanted. It did a sort on VM, but it did so in ascending order, with the largest values at the bottom of the list. By reading help for the sort-object, we see that it has a -descending parameter...