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
-
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 PowerCLIThis command installs all the Horizon PowerCLI modules into Windows PowerShell. The
VimAutomation.HorizonViewmodule is the Horizon PowerCLI module.For more information on how to install Horizon PowerCLI, see the Horizon PowerCLI User's Guide.
-
Import the Horizon PowerCLI module named
VimAutomation.HorizonViewin the Windows PowerShell session.Use the following command to import
VimAutomation.HorizonViewinto the Windows PowerShell session:Import-Module -Name VimAutomation.HorizonViewVimAutomation.HorizonViewcontains theConnect-HVServerandDisconnect-HVServercmdlets that you can use to connect to a Horizon Connection Server or disconnect from a Horizon Connection Server. -
Pull sample scripts from the github repository.
After you use the
Connect-HVServercmdlet 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?