title: Perfmon.exe not showing values for Network Interface via powershell
body: <p>I've been trying to make powershell make a csv file with certain information in Windows 7's perfmon.exe</p>
  
  <p>Most of it works, but it seems to ignore 3 counters.</p>
  
  <p>The script looks like the following:</p>
  
  <pre><code>$SampleInterval="4"
  $MaxSamples="15"
  $FileDestinationFolder="C:\Perfmon"
  $date = (Get-Date).ToShortDateString()
  Get-Counter 
  $gc = ('\Network Interface(`*)\Current Bandwith', 
          '\Network Interface(`*)\Packets Recieved/sec',
          '\Network Interface(`*)\Packets Sent/sec',
          '\PhysicalDisk(_Total)\Disk Write Bytes/sec',
          '\PhysicalDisk(_Total)\Disk Read Bytes/sec',
          '\Processor(_Total)\% Processor Time',
          '\Processor(_Total)\% Idle Time',
          '\Memory\% Committed Bytes In Use',  
          '\Memory\Available MBytes')
  Get-Counter -counter $gc -SampleInterval $SampleInterval -MaxSamples $MaxSamples | export-counter -force -path ("$FileDestinationFolder\PerfMon-$date.csv") -FileFormat csv
  </code></pre>
  
  <p>I do get stats for PhysicalDisk, Processor and Memory, but none of the Network Interfaces. The path for Network Interface is fetched from the Data Collector itself. 
  Any clue why this may be so?</p>
  
  <p>EDIT --
  If I read them in alone, I can see that it prints all the network interfaces in the Powershell ISE, but doesn't write the content to the csv file.</p>
  
  <p>Example on output is </p>
  
  <blockquote>
    <p>Timestamp                 CounterSamples<br>
    ---------                 --------------<br>
    06-12-2012 15:13:30       \dkspare03\network interface(intel[r] 82577lm gigabi
                              t network connection)\bytes total/sec :<br>
                              27101,2080498825                                     </p>
  </blockquote>
  
  <pre><code>                      \\dkspare03\network interface(intel[r] centrino[r] ad
                        vanced-n 6200 agn)\bytes total/sec :                 
                        0
  </code></pre>
  
  <p>Currently, Network Interface has an escape character where it tells what NIC to read.
  In case I do not have it, powershell enlist an error as following:</p>
  
  <blockquote>
    <p>Get-Counter : Internal performance counter API call failed. Error: c0000bb9.
    At line:38 char:12
    + Get-Counter &lt;&lt;&lt;&lt;  -counter $gc -SampleInterval $SampleInterval -MaxSamples $M
    axSamples | export-counter -force -path ("$FileDestinationFolder\PerfMon-$date.
    csv") -FileFormat csv
        + CategoryInfo          : InvalidResult: (:) [Get-Counter], Exception
        + FullyQualifiedErrorId : CounterApiError,Microsoft.PowerShell.Commands.Ge 
       tCounterCommand</p>
  </blockquote>