title: How to implement using statement in powershell?
body: <p>How can I write using in power shell ?</p>
  
  <p>This is working example in C#</p>
  
  <pre><code>using (var conn = new SqlConnection(connString))
  {
      Console.WriteLine("InUsing");
  }
  </code></pre>
  
  <p>I need same in Powershell (not working):</p>
  
  <pre><code>Using-Object ($conn = New-Object System.Data.SqlClient.SqlConnection($connString)) {
  
      Write-Warning -Message 'In Using';          
  }
  </code></pre>
  
  <p>It is working without using:</p>
  
  <pre><code>$conn = New-Object System.Data.SqlClient.SqlConnection($connString)
  </code></pre>
  
  <p>Thank you for help.</p>