Hi,
everytime i run a powershell-script by using webCommander i get this error:
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.
Apparently the PowerCLI Modules are not registered properly. So I changed my "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\profile.ps1" from the recommended:
[Reflection.Assembly]::LoadWithPartialName('system.web') | out-null add-pssnapin vmware* -ea SilentlyContinue $env:defaultPassword = 'replace this with a real password'
to this
[Reflection.Assembly]::LoadWithPartialName('system.web') | out-null
Get-Module -Name VMware* -ListAvailable | Import-Module -ea SilentlyContinue
$env:defaultPassword = 'test1234!'
Now the Modules are registered properly at least when running PowerCLI directly on the Sserver where webCommander is installed on. Before the change I got this error:
Out-Null : A positional parameter cannot be found that accepts argument 'add-pssnapin'.
At C:\Windows\SysWOW64\WindowsPowerShell\v1.0\profile.ps1:1 char:60
- [Reflection.Assembly]::LoadWithPartialName('system.web') | out-null add-pssnapin ...
- CategoryInfo : InvalidArgument: (:) [Out-Null], ParameterBindingException
- FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.OutNullCommand
But on the Webcommander page i still get the message that the modules are not recognized. Webpage and all the other stuff are running correctly as far as I can see so far.
What can i change to get this going?
Many thanks in advance!
Best
Ben