Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
cls
$sql_connection_string = "SERVER=.;Integrated Security=True;Database=master"
$sql_connection = new-object System.Data.SqlClient.SqlConnection ($sql_connection_string)
try {
$sql_connection.Open()
return $sql_connection.Database
}
catch {
Write-Error $_.Exception
Throw
}
$sql_connection.Dispose();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment