PowerCLI

 View Only
  • 1.  Not recognized as the name of a cmdlet, function

    Posted Sep 24, 2021 04:51 AM

    I'm running PowerShell script like below:

    ...
    Install-Module -Name VMware.PowerCLI -Force
    Connect-HVServer -Server ...  -User ...
    Set-HVEventDatabase -ServerName ... -DatabaseType ...

    As I remember, It worked in the old powercli version. When I install a new VM (Windows Server 2019) and run it, I got this error:

    Set-HVEventDatabase : The term 'Set-HVEventDatabase' 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.

    My current PowerCLI version is 12.4.0

    hidro_franxi_0-1632458689883.png

    Which module do I need to install to run Set-HVEventDatabase ?

    Thanks.



  • 2.  RE: Not recognized as the name of a cmdlet, function
    Best Answer

    Posted Sep 24, 2021 06:23 AM

    The Set-HVEventDatabase cmdlet is not part of the regular PowerCLI distribution, but comes in the VMware.Hv.Helper module.



  • 3.  RE: Not recognized as the name of a cmdlet, function

    Posted Sep 24, 2021 09:45 AM

    I've already added VimAutomation.HorizonView, but for sure, I added it in the script and still got the same error.

    hidro_franxi_0-1632476400294.png

    hidro_franxi_2-1632476606379.png

     

     



  • 4.  RE: Not recognized as the name of a cmdlet, function

    Posted Sep 24, 2021 09:51 AM

    That is not what I said, you need the VMware.Hv.Helper module for that cmdlet, not the VimAutomation.HorizonView module.



  • 5.  RE: Not recognized as the name of a cmdlet, function

    Posted Sep 24, 2021 12:01 PM

    Thanks, I got it.