invoke-sqlcmd Not Recognized

The term ‘invoke-sqlcmd’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

The Invoke-sqlcmd cmdlet is not included as part of PowerShell, but instead it is of sqlps (SQL Server 2008 PowerShell Host). Therefore, before using invoke_sqlcmd you should install SSMS  or the SQL Server 2008 Feature Pack . SQL Server 2008 Feature Pack allows you to install sqlps and its required assemblies (SMO and MSMXL 6.0) without any requirement for installing SSMS. When sqlps has been installed, you may then load invoke-sqlcmd into powershell.exe by using the below script: http://blogs.msdn.com/b/mwories/archive/2008/06/14/sql2008_5f00_powershell.aspx ]]>

Leave a comment

Your email address will not be published.