Count in Select-Object

Aus Wiki-WebPerfect
Version vom 9. Januar 2019, 12:32 Uhr von Admin (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

Examples

Show all "svchost" process with property "ProcessName" & "Id" and the count of property Modules

Get-Process -Name svchost | select ProcessName, Id, @{n="NumberOfModules";e={($_.Modules | measure).count}}


Show all VMHost-Cluster process with property "Name" & "Nodes" and the count of property Nodes

Get-SCVMHostCluster | select Name, Nodes, @{n="Count";e={($_.Nodes | measure).count}}