Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Need help with table (hashtable?) formatting

$
0
0

I've write a simple script to  get remote counters reagarding to disk performance:

$counter_read_latency="\PhysicalDisk(*)\Avg. Disk sec/Read"$counter_write_latency="\PhysicalDisk(*)\Avg. Disk sec/Write"$counter_read_IOPS="\PhysicalDisk(*)\Disk Reads/sec"$counter_write_IOPS="\PhysicalDisk(*)\Disk Writes/sec"while ($true)
{Clear$read_IOPS=Get-Counter-Counter$counter_read_IOPS-ComputerName$args[0] $read_IOPS.CounterSamples | Select-Object InstanceName, CookedValue | Format-Table @{Expression={$_.InstanceName}; Label="DISK NAME $args[0]" }, @{Expression={[decimal]::Round($_.CookedValue *1)}; Label="Read IOPS"}$write_IOPS=Get-Counter-Counter$counter_write_IOPS-ComputerName$args[0]$write_IOPS.CounterSamples | Select-Object InstanceName, CookedValue | Format-Table @{Expression={$_.InstanceName}; Label="DISK NAME $args[0]" }, @{Expression={[decimal]::Round($_.CookedValue *1)}; Label="Write IOPS"}$read_latency=Get-Counter-Counter$counter_read_latency-ComputerName$args[0] $read_latency.CounterSamples | Select-Object InstanceName, CookedValue | Format-Table @{Expression={$_.InstanceName}; Label="DISK NAME $args[0]" }, @{Expression={[decimal]::Round($_.CookedValue *1000)}; Label="Read ms latency"}$write_latency=Get-Counter-Counter$counter_write_latency-ComputerName$args[0]$write_latency.CounterSamples | Select-Object InstanceName, CookedValue | Format-Table @{Expression={$_.InstanceName}; Label="DISK NAME $args[0]" }, @{Expression={[decimal]::Round($_.CookedValue *1000)}; Label="Write ms latency"}Start-Sleep10
}

What I like to have this output in one table:

disk name read iops write iops read latency write latency

but I don't have knoledge how to mergo those separate tables into one.
I would like to ask for help with this.

Viewing all articles
Browse latest Browse all 8583

Trending Articles