Count in Select-Object: Unterschied zwischen den Versionen

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „== Examples == === Show all "svchost" process with property "ProcessName" & "Id" and the count of property Modules === <source lang="powershell">Get-Process -N…“)
 
(kein Unterschied)

Aktuelle Version vom 9. Januar 2019, 13:32 Uhr

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}}