Count in Select-Object

Aus Wiki-WebPerfect
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}}