The module is installed in the normal location..C:\Windows\System32\WindowsPowerShell\v1.0\Modules
When I run the Jenkins service under my account I still get the same issues but inetractively from the Powershell prompt PowerCli is fine.
Looking at the built tho it still says its running as System
Started by user admin
Running as SYSTEM
Building in workspace C:\Program Files (x86)\Jenkins\workspace\ps-test1
[ps-test1] $ powershell.exe -NonInteractive -ExecutionPolicy Bypass -File C:\Users\DA_HOW~1\AppData\Local\Temp\jenkins4121092801461908652.ps1
import-module : The specified module 'VMware.PowerCLI' was not loaded because no valid module file was found in any
module directory.
At C:\Users\da_howardm\AppData\Local\Temp\jenkins4121092801461908652.ps1:3 char:1
+ import-module VMware.PowerCLI
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (VMware.PowerCLI:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
connect-viserver : The term 'connect-viserver' 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.