Last active
February 26, 2019 22:01
-
-
Save niktho/0f8e7f6773b8e3b377b02253630b07aa 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
$connectionString = "<ADD YOUR CONNECTION STRING HERE>" | |
$sqlCommand = 'BEGIN TRY EXEC tSQLt.RunAll END TRY BEGIN CATCH END CATCH; EXEC tSQLt.XmlResultFormatter' | |
$connection = new-object system.data.SqlClient.SQLConnection($connectionString) | |
$command = new-object system.data.sqlclient.sqlcommand($sqlCommand,$connection) | |
$connection.Open() | |
$adapter = New-Object System.Data.sqlclient.sqlDataAdapter $command | |
$dataset = New-Object System.Data.DataSet | |
$adapter.Fill($dataSet) | Out-Null | |
$connection.Close() | |
$dataSet.Tables[0].Rows[0].ItemArray[0] | Out-File "$(System.DefaultWorkingDirectory)/_ndev-db-CI/drop/azure-sql-database/TEST-ndevdb.xml" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment