Write-Verbose $sql;
# if windows user has not enough rights use other eg.: -Username sa -Password xxx
$ret=invoke-sqlcmd -Query $sql -serverinstance $ServerInstance -Database $Database
#display in cmd window
write-host ($ret | Format-Table | Out-String)
#display in new window with columns
$Ret | Out-GridView
No comments:
Post a Comment