Im new to powershell and found this script to get server performance. When you execute this command, you will get a column called “Path”. How would you rename this or add new row for betters understanding. I have tried foreach but they will be executed one at a time and will not be accurate data. They need to be executed at once to capture the performance of the server at that exact time for all performance counters. Our environment are still running on PS 5.1 (including windows 2016/2019).
Example labels:
Read Latency = “\LogicalDisk()\Disk Reads/sec"
Write Latency = "\LogicalDisk()\Disk Writes/sec”
=====
$counters =
@( "\Processor(_Total)\% Processor Time"
,“\Memory\Available MBytes” ,"\Paging File(_Total)\% Usage"
,“\LogicalDisk()\Avg. Disk Bytes/Read" ,"\LogicalDisk(*)\Avg. Disk Bytes/Write"
,"\LogicalDisk()\Avg. Disk sec/Read” ,"\LogicalDisk(*)\Avg. Disk sec/Write"
,“\LogicalDisk()\Disk Read Bytes/sec" ,"\LogicalDisk(*)\Disk Write Bytes/sec"
,"\LogicalDisk()\Disk Reads/sec” `
,“\LogicalDisk(*)\Disk Writes/sec”
)
(Get-Counter $counters).countersamples