Powershell sql server invoke sqlcmd

I am in the process of putting my notes into web pages, please keep checking in later for more contents

Powershell Version

SQL Server PowerShell (SQLPS)

SQL Server Management Objects (SMO) smo 

.NET (System.Data.SqlClient) sqlclient 

Invoke-SqlCmd invoke_sqlcmd 


Get-Module -ListAvailable
Import-Module -Name SQLPS
Import-Module -Name SqlServer


Get-Command -Module SQLPS
Get-Command -Module SQLSERVER

New-Alias sql Invoke-Sqlcmd 

Invoke-SqlCmd -ServerInstance -Database -Query -Username -Password

Invoke-Sqlcmd -Query "SELECT GETDATE() AS TimeOfQuery;" -ServerInstance "MyComputer\MyInstance" -Username $MyLogin -Password $pwd  


msdn Powershell