Note that there are some explanatory texts on larger screens.

plurals
  1. POPerformance counters not being written by Powershell job
    primarykey
    data
    text
    <p>I'm working on setting up a script that can be run from any Windows servers to gather some perfmon scripts in the background in a rolling log file. I could use the PerfMon GUI, but I figured this would give me a good opportunity to learn some Powershell at the same time, and I could wrap it all in my own simplified GUI based on what my project specifically needs.</p> <p>Basically, the script verifies that the ExecutionPolicy is set to remotesigned (so it can run), then defines a couple of variables for usage in the following commands, and outlines the counters to grab.</p> <p>After that, it stores the command as a variable and then starts it as a job. The problem is that I'm never seeing the results of that job in the form of the .csv file I'm asking for. Here's the code:</p> <pre><code>Set-ExecutionPolicy remotesigned -Force $Computer = $env:COMPUTERNAME $1GBInBytes = 1GB $p = "\\$Computer\Process(System)\% Processor Time", "\\$Computer\PhysicalDisk(_Total)\Current Disk Queue Length", "\\$Computer\PhysicalDisk(0 c:)\% Disk Time", "\\$Computer\PhysicalDisk(0 c:)\Avg. Disk Queue Length", "\\$Computer\PhysicalDisk(0 c:)\% Disk Read Time", "\\$Computer\PhysicalDisk(0 c:)\Avg. Disk Read Queue Length", "\\$Computer\PhysicalDisk(0 c:)\% Disk Write Time", "\\$Computer\PhysicalDisk(0 c:)\Avg. Disk Write Queue Length", "\\$Computer\PhysicalDisk(0 c:)\Avg. Disk sec/Transfer", "\\$Computer\PhysicalDisk(0 c:)\Avg. Disk sec/Read", "\\$Computer\PhysicalDisk(0 c:)\Avg. Disk sec/Write", "\\$Computer\PhysicalDisk(0 c:)\Disk Transfers/sec", "\\$Computer\PhysicalDisk(0 c:)\Disk Reads/sec", "\\$Computer\PhysicalDisk(0 c:)\Disk Writes/sec", "\\$Computer\PhysicalDisk(0 c:)\Disk Bytes/sec", "\\$Computer\PhysicalDisk(0 c:)\Disk Read Bytes/sec", "\\$Computer\PhysicalDisk(0 c:)\Disk Write Bytes/sec", "\\$Computer\PhysicalDisk(0 c:)\Avg. Disk Bytes/Transfer", "\\$Computer\PhysicalDisk(0 c:)\Avg. Disk Bytes/Read", "\\$Computer\PhysicalDisk(0 c:)\Avg. Disk Bytes/Write", "\\$Computer\PhysicalDisk(0 c:)\% Idle Time", "\\$Computer\PhysicalDisk(0 c:)\Split IO/Sec"; $counter = {get-counter -counter $p -Continuous | Export-Counter C:\PerfLogs\Storage_BBCRM.csv -Force -FileFormat CSV -Circular -MaxSize $1GBInBytes} Start-job $counter </code></pre> <p>Any ideas? For right now, I'd like to kick off the job as a background job and I'll stop it via a separate powershell command. I just want it to roll all of that into a .csv though.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload