Hi I have been having some issues getting invoke-sqlcmd working from one of my machines. I followed these instructions: Problems using SQL Server 2008 R2 PowerShell extensions outside of SQLPS
I also installed https://www.microsoft.com/en-us/download/details.aspx?id=42295 SharedManagementObjects and PowershellTools using DSC and confirmed in output that it's installed. But when I tried to add it using:
Add-PSSnapin SqlServerCmdletSnapin100
Add-PSSnapin SqlServerProviderSnapin100
It throws an error message that
SqlServerCmdLetsnapin100 and SqlServerProviderSnapin100 are not installed on the computer
I also tried importing sqlps module. The machine I'm having this issue on is Win 2012 R2.
Thanks
Note: This is happening randomly on a few machines. We need the sql provider snap installed on all machines.