VMware Cloud Community
NeenaJim
Enthusiast
Enthusiast
Jump to solution

The term 'Connect-VIServer' is not recognized as the name of a cmdlet

Hi,

I haveWin 2016 server which doesnt have internet connection.

If I run the command 'Connect-VIServer -Server <VC>' then I was getting the error: The term 'Connect-VIServer' is not recognized as the name of a cmdlet

Hence I downloaded : 'VMware.VimAutomation.Core 11.5.0.14899560' from the below link from my local machine and copied the file 'vmware.vimautomation.core.11.5.0.14899560.nupkg' into that 2016 server in the location: D:\New folder

https://www.powershellgallery.com/packages/VMware.VimAutomation.Core/11.5.0.14899560

Then I ran the command

Unblock-File -Path 'D:\New folder\vmware.vimautomation.core.11.5.0.14899560.nupkg'

And then changed the format to vmware.vimautomation.core.zip and then extracted it.

Then I copied that new extracted folder to C:\Windows\System32\WindowsPowerShell\v1.0\Modules

Then I opened the powershell as Admin and then ran the command and I was getting this error:

PS C:\WINDOWS\system32>> Install-module 'C:\Windows\System32\WindowsPowerShell\v1.0\Modules\vmware.vimautomation.core'

WARNING: Unable to download the list of available providers. Check your internet connection.

PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.

PS C:\WINDOWS\system32>> Import-module C:\Windows\System32\WindowsPowerShell\v1.0\Modules\vmware.vimautomation.core

Import-module : The required module 'VMware.VimAutomation.Cis.Core' is not loaded. Load the module or remove the module from 'RequiredModules' in the file

'C:\Windows\System32\WindowsPowerShell\v1.0\Modules\vmware.vimautomation.core\vmware.vimautomation.core.psd1'.

PS C:\WINDOWS\system32>> Connect-VIServer -Server <VC>

Connect-VIServer : The 'Connect-VIServer' command was found in the module 'vmware.vimautomation.core', but the module could not be loaded. For more information, run 'Import-Module vmware.vimautomation.core'.

Any help please?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Can you try the method described in PowerCLI Offline Installation Walkthrough and check if that gives the same result?

Remove all current PowerCLI folders before you do that.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

Can you try the method described in PowerCLI Offline Installation Walkthrough and check if that gives the same result?

Remove all current PowerCLI folders before you do that.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
HelionAL
Contributor
Contributor
Jump to solution

Solution:

Check the execution policy

Get-ExecutionPolicy - if it is restricted change it to RemoteSigned

Set-ExecutionPolicy RemoteSigned

If you are getting cert error:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Why are you posting this reply?
The execution policy has nothing to do with the issue the poster reported.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos