title: Powershell NetEventSession
body: <p>I'm trying to run the following script, however i keep getting the error below:</p>
  
  <p>Script:</p>
  
  <pre><code>param(
    [UInt16]$port=25
  )
  
  New-NetEventSession -Name "Capture" -CaptureMode RealtimeLocal -LocalFilePath "C:\Users\5.etl"
  
  Add-NetEventWFPCaptureProvider -SessionName "Capture" -TCPPorts $port
  
  Start-NetEventSession -Name "Capture"
  </code></pre>
  
  <p>and the error I get is:</p>
  
  <blockquote>
  <pre><code>Error: Start-NetEventSession : A general error occurred that is not
  covered by a more specific error code. At
  C:\Users\shaun\Documents\Untitled1.ps1:6 char:1
  + Start-NetEventSession -Name "Capture"
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (MSFT_NetEventSe...477B5AAB18AF}"):root/StandardCimv2/MSFT_NetEventSession) [St     art-NetEventSession], CimException
      + FullyQualifiedErrorId : MI RESULT 1,Start-NetEventSession
  </code></pre>
  </blockquote>
  
  <p>Any thoughts? </p>
  
  <p>I'm new to coding &amp; PowerShell, and I appreciate any help on this.</p>