Skip to main content

March 25, 2025

Set Up the Horizon PowerCLI Module

You can setup the Horizon PowerCLI module with Omnissa Horizon PowerCLI and use the Horizon PowerCLI cmdlets to connect or disconnect from Omnissa Horizon Connection Server. After you connect to the Horizon Connection Server, you can write PowerShell scripts that invoke the Horizon APIs.

Procedure

  1. Install Horizon PowerCLI.

    Install Horizon PowerCLI from the PowerShell Gallery. To install Horizon PowerCLI, run the following command in the Windows PowerShell prompt:

    Install-Module -Name Horizon PowerCLI 
    
    
    

    This command installs all the Horizon PowerCLI modules into Windows PowerShell. The VimAutomation.HorizonView module is the Horizon PowerCLI module.

    For more information on how to install Horizon PowerCLI, see the Horizon PowerCLI User's Guide.

  2. Import the Horizon PowerCLI module named VimAutomation.HorizonView in the Windows PowerShell session.

    Use the following command to import VimAutomation.HorizonView into the Windows PowerShell session:

    Import-Module -Name VimAutomation.HorizonView 
    		  
    

    VimAutomation.HorizonView contains the Connect-HVServer and Disconnect-HVServer cmdlets that you can use to connect to a Horizon Connection Server or disconnect from a Horizon Connection Server.

  3. Pull sample scripts from the github repository.

    After you use the Connect-HVServer cmdlet to connect to the Horizon API service of the Horizon Connection Server, you can run PowerShell scripts that invoke the Horizon APIs. For more information about Horizon APIs, see the View API Reference documentation.

What to do next

Use the example scripts directly or modify the scripts to suit your automation needs. Apart from example scripts, you can also develop new scripts that invoke Horizon APIs based on your needs. See, [Run Example Horizon PowerCLI Scripts](RunExampleHorizonHorizon PowerCLIScripts.md).

Was this page helpful?

Provide feedback for this topic

Was this topic helpful?

Please do not include any personal or confidential information.

Generating link…