PowerCLI

  • 1.  "VMware.hv.helper" Module not available. Need some help desperately.

    Posted Jan 15, 2025 11:35 AM
    Edited by hoon0715 Jan 15, 2025 11:36 AM

    Hi,

    I realize that the Horizon View product has become a product of Omnissa, but I'm familiar with the VMware (Broadcom) Community, so please forgive me for asking my question here.

    The question is this.
    I'm trying to connect to the Connection Server via Powershell to work on user assignments and assigning computers to desktop pools, but I keep getting an unknown error when I run the HV Commands as below.

    Cannot convert "service" argument with value "VMware.Hv.Services" to "VMware.Hv.Services" type for "QueryService_Delete": "Unable to convert "VMware.Hv.Services" value of "VMware.Hv.Services" type to "VMware.Hv.Services" type."

    Location C:\Program Files\WindowsPowerShell\Modules\Omnissa.Hv.Helper\Omnissa.HV.Helper.psm1:7692 character:5
    + $query_service_helper.QueryService_Delete($services, $queryResult ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument

    Powershell version is 5.1 (I've also tried 7.1) and Horizon is version 2406.

    Both the 'Omnissa.Hv.Helper' and 'VMware.Hv.Helper' modules generate the same error message.
    Even a 'Get-HVPool' command will not run.
    ('Get-HVLicense' does work).
    I did a lot of searching and imported all the modules I needed, so I don't think that's the issue.
    Please help me.
    I've actually been trying to solve this problem all day, but it's beyond my skills.
    Thank you in advanced.


  • 2.  RE: "VMware.hv.helper" Module not available. Need some help desperately.

    Posted Jan 15, 2025 12:39 PM

    Can you show us the code you are using?



    ------------------------------


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


    ------------------------------



  • 3.  RE: "VMware.hv.helper" Module not available. Need some help desperately.

    Posted Jan 15, 2025 01:02 PM

    Thank you for reply.

    I just ran command as below,

    Set-ExecutionPolicy RemoteSigned
    Set-PowerCLIConfiguration -InvalidCertification Ignore -Confirm:$false
    Set-PowerCLIConfiguration -Scope User -ParticipateCEIP $false

    Import-Module VMware.PowerCLI

    Import-Module VMware.VimAutomation.Horizonview (OR Omnissa.VimAutomation.Horizonview)

    Import-Module VMware.Hv.Helper (OR Omnissa.Hv.Helper)

    Connect-HVserver -Server CS_HOSTNAME -User ID@Domain -Password PASSWORD

    Get-HVPool 

    ----------------------------------------------------------

    The error message in the post is Get-SOMETHING. However, the Get-HVPool command also ends up with the error message "Unable to convert" and says that no results can be retrieved via the parameters. 




  • 4.  RE: "VMware.hv.helper" Module not available. Need some help desperately.

    Posted Jan 15, 2025 01:17 PM

    Did you make sure that the "PASSWORD" is of the type SecureString?



    ------------------------------


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


    ------------------------------



  • 5.  RE: "VMware.hv.helper" Module not available. Need some help desperately.

    Posted Jan 15, 2025 01:27 PM

    I'm sorry, but I don't know exactly what is the SecureString....

    I just use PASSWORD when I logon in the Horizon Admin Page.. (Capitalization is not included)




  • 6.  RE: "VMware.hv.helper" Module not available. Need some help desperately.

    Posted Jan 15, 2025 01:57 PM

    Consult the Connect-HVServer help, specifically the Default parameterset.

    To convert from a String to a SecureString you can use the ConvertTo-SecureString cmdlet.
    Something like this for example.

    $pswd = 'VMware1!'
    $pswdSecure = ConvertTo-SecureString -String $pswd -AsPlainText -Force


    ------------------------------


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


    ------------------------------



  • 7.  RE: "VMware.hv.helper" Module not available. Need some help desperately.

    Posted Jan 15, 2025 02:02 PM

    I didn't try what you suggested because I didn't see anything about SecureString in the VMware and Omnissa KBs.

    I'll try that as soon as I get back to work in 8 hours!

    It'll this help solve the 'Unable to Convert' error??