Hi,
I am
currently trying to do CI for databases using flywayDB, where I need powershell
in Jenkins. I have a jenkins setup which works fine with a linux and windows machines, tested a basic poweshell commands in ajob and it works like a charm.
In my CI scenario, I have a Win 2K12 Box with sql 2012
remoting enabled (this is not a slave and I don't want it to be) , I can run powershell script or code
directly from my laptop or the jenkins machine inside ISE against, one of the statements is
Import-Module sqlps -DisableNameChecking
as I need to navigate and work with sql server .
When running the same code from jenkins job always this statement blow up the job as follows
Import-Module : The specified module 'sqlps' was not loaded because no valid module file was found in any module directory.
which works fine when I run it in ISE. I invoke the command with admin credentials as follows
$password = ConvertTo-SecureString "mypassword" -AsPlainText -Force
$cred= New-Object System.Management.Automation.PSCredential ("mydomain\myuser", $password )
Enter-PSSession -ComputerName SQL2K12 -Credential $cred
Thanks for your help