I am practicing Powershell and the question that I have been assigned is as follows:
Write a pipeline to get-process where cpu utilization is greater than zero, return properties not shown in default view and sort the results by CPU descending
Currently I think I have completed everything except for the requirement of non default properties, which I assume can be done by the Select-Object cmdlet.
Code I have so far:
Get-Process | Where-Object {$_.CPU -gt 0 } | Select-Object -Property * | sort -Descending
I know the asterisks is a moniker for selecting all properties but I don't know how to set up a Boolean check for if the property is in the default view or not. Can someone please help me?