String manipulation

by Jan 8, 2014

I execute this against a server


$serverName = "BEAST"
@(  "\$serverNamePhysicalDisk(*)Avg. Disk Read Queue Length",
    "\$serverNamePhysicalDisk(*)Avg. Disk Write Queue Length",
    "\$serverNamePhysicalDisk(*)Avg. Disk sec/Read",
    "\$serverNamePhysicalDisk(*)Avg. Disk sec/Write",
    "\$serverNamePhysicalDisk(*)Disk Read Bytes/sec",
    "\$serverNamePhysicalDisk(*)Disk Reads/sec",
    "\$serverNamePhysicalDisk(*)Disk Write Bytes/sec",
    "\$serverNamePhysicalDisk(*)Disk Writes/sec"
    ) |% {
    (Get-Counter $_.replace("*","1 c:")).CounterSamples } |
    Select-Object Path, CookedValue | `
    add-Member -memberType noteProperty -name Server -value $servername -passThru


The Path results look like

\beastphysicaldisk(1 c:)avg. disk read queue length


Since most servers have multiple drives how can I have it iterate through each one.  Physical drives, not logical.