Last active
May 15, 2022 07:47
-
-
Save RichieBzzzt/8f67dc6d82a0935b432cbcd4f2954873 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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