SyntaxFix
Write A Post
Hire A Developer
Questions
You can use the Invoke-Sqlcmd cmdlet
Invoke-Sqlcmd
Invoke-Sqlcmd -Query "SELECT GETDATE() AS TimeOfQuery;" -ServerInstance "MyComputer\MyInstance"
http://technet.microsoft.com/en-us/library/cc281720.aspx