Reply to Message

View discussion in a popup

Replying to:
snktech
Enthusiast
Enthusiast

Still no luck. Completely removed Powershell then went through the PS Environment variables and checked every single directory to make sure there was nothing there, did a new install, then added the module with:

Install-Module -Name 'VMware.PowerCLI' -Scope AllUsers

 

Installed just fine, this time to /usr/local/share/powershell/Modules which the log of the script shows is where the module is being pulled from. But still getting the same result:

 

PS Environment Variables:
/tmp/cd37f0ff-da59-43ac-84e1-c8e2c8e4b78b/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/usr/bin/powershell/Modules

    Directory: /usr/local/share/powershell/Modules

ModuleType Version    PreRelease Name                                PSEdition
---------- -------    ---------- ----                                ---------
Script     12.5.0.19…            VMware.CloudServices                Desk
etc.

Connect-VIServer: /root/scripts/VMShutDown/test.ps1:16
Line |
  16 |      Connect-VIServer $server -Credential $pscreds
     |      ~~~~~~~~~~~~~~~~
     | 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'.

 

Only thing I can think of is to redeploy the server entirely but somewhat at a loss as to what that would achieve given powershell is just an extracted directory.

Reply
0 Kudos