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 

$PSVersionTable
$PSVersionTable.PSVersion

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

%ProgramFiles%\WindowsPowerShell\Modules\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  


Reference

msdn Powershell