title: Timeout powershell command
body: <p>I'm using ODP.net with Powershell to execute query on my Oracle Database.</p>
  
  <p>I want to time-out the execution of my query. This is my code : </p>
  
  <pre><code>[void][System.Reflection.Assembly]::LoadFile("C:\Oracle.ManagedDataAccess.dll")
  $OracleConnexion = New-Object Oracle.ManagedDataAccess.Client.OracleConnection('User Id=test;Password="test";Data Source=10.0.0.0/TEST')
  
  $FluxSiebel = "SELECT * FROM BLABLA"
  
  Try { 
  
      $OracleConnexion.Open()
  
  }Catch { 
  
      Write-Output "Connection KO"
      $OracleConnexion
      Exit 2
  }
  
  
  $Query=$OracleConnexion.CreateCommand()
  $Query.CommandText=$FluxSiebel
  
  $TimeTaken=  (Measure-Command  {
  
      $ExecuteQuery=$Query.ExecuteReader()
  
  }).TotalMilliseconds | Out-String
  </code></pre>
  
  <p>I want to add a timeout of 1minutes on this section of my code : <code>$ExecuteQuery=$Query.ExecuteReader()</code></p>
  
  <p>How can I do this? I can't find any cmdlet doing this...</p>
  
  <p>Thanks</p>