PowerCLI

 View Only
  • 1.  Cant Import-Module .\VMware.VimAutomation.Core.psd1

    Posted Jan 04, 2024 05:34 AM

    Powershell 7.4
    Windows server 2019

    As far as I can see is VMware-PowerCLI-13.2.1-22851661 is compatible with Powershell 7.4

    I´m trying to install Module in Powershell 7.4.

    PS C:\Scripts\VMware-PowerCLI-13.2.1-22851661\VMware.VimAutomation.Core\net472> Import-Module .\VMware.VimAutomation.Core.psd1
    InvalidOperation: C:\Scripts\VMware-PowerCLI-13.2.1-22851661\VMware.VimAutomation.Core\net472\VMware.VimAutomation.Core.ps1:1
    Line |
    1 | [VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory]::CoreService …
    | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | Unable to find type [VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory].
    Import-Module: Could not load file or assembly 'VMware.VimAutomation.Sdk.Interop, Version=13.2.0.5660, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
    PS C:\Scripts\VMware-PowerCLI-13.2.1-22851661\VMware.VimAutomation.Core\net472>

    I really appreciate your answer



  • 2.  RE: Cant Import-Module .\VMware.VimAutomation.Core.psd1

    Posted Jan 04, 2024 06:40 AM

    Why do you import the module in such a way?
    Did you try to do

    Import-Module -Name VMware.PowerCLI


  • 3.  RE: Cant Import-Module .\VMware.VimAutomation.Core.psd1

    Posted Jan 04, 2024 07:53 AM

    :
    This work if the VMware PowerCLI module is already installed.
    In this case It´s not and this server has not internet connection.
    Now I transfer the whole Module and only want to import/install the  VMware.VimAutomation.Core.psd1 so I can read the traffic
    that flow trough a VMware vsphere vSwitch. 
    But I do really appreciate any suggestions of how to solve this.

    :0)



  • 4.  RE: Cant Import-Module .\VMware.VimAutomation.Core.psd1

    Posted Jan 04, 2024 09:30 AM

    That module, as the error indicates, relies on types defined in other modules.
    You will have to install those modules as well.
    The easiest method is to install all modules, that way the required modules for the types can be found.