Skip to content

Instantly share code, notes, and snippets.

@martin9700
Created November 30, 2014 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save martin9700/3abafb25a8b0a61999e0 to your computer and use it in GitHub Desktop.
Save martin9700/3abafb25a8b0a61999e0 to your computer and use it in GitHub Desktop.
Try {
$Records = $DataAdapter.Fill($DataSet)
If ($DataSet)
{ $DataSet.Tables[0] | Add-Member -MemberType NoteProperty -Name Instance -Value $SQLServer
Write-Output $DataSet.Tables[0]
}
Else
{ Write-Warning "Query did not return any records"
}
}
Catch {
Write-Warning "$($_.Exception.Message)"
}
$SqlConnection.Close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment