How can I write use in a power shell?
This is a working example in C #
using (var conn = new SqlConnection(connString)) { Console.WriteLine("InUsing"); }
I need the same in Powershell (not working):
Using-Object ($conn = New-Object System.Data.SqlClient.SqlConnection($connString)) { Write-Warning -Message 'In Using'; }
It works without using:
$conn = New-Object System.Data.SqlClient.SqlConnection($connString)
Thank you for your help.
c # powershell
Raskolnikov
source share