Change or Add ROW label

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

tiktak,
Welcome to the forum. :wave:t4:

If I got it right you can use

together with a

to add additional infromation or transform existing infromation.

BTW: When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org <---- Click :point_up_2:t4: :wink:

this is noted.will follow next time…

yes, weve tried foreach and select-object but it executed the performance counter one at a time instead.