We are not able to run “invoke-sqlcmd” command on client (node).
As a solution we found out that Powershell 5 and SqlServer Module is needed on the server to enable it to run invoke-sqlcmd cmdlet. But even after downlaoding sqlserver module it is not working.
On further investigating we found out that “PSModulePath” Environment variable needs to have “;E:\Program Files(X64)\Microsoft SQL Server\120\Tools\PowerShell\Modules” in it’s value. But this is also not working and Chef-client will fail with msg
“invoke-sqlcmd is not recognised as cmdlet”
And if I set the environment variable again with the same value. Chef-client executes successfully without the last error. However the SqlServer module that I download on server disapperas from the path “C:\Program Files\Winddows Powershell\Modules”
I am not able to understand this behavior of chef-client. Kindly advise.