When attempting to run the invoke_sqlcmd from PowerShell you may receive the below exception:
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
var idcomments_acct = ’62089e20c30196b091933230f42f0718′;var idcomments_post_id;var idcomments_post_url;View the original article here
Impressive submit, I really look forward to posts of your stuff.