Horizon Powershell Module
The Omnissa Horizon Powershell module (Omnissa.VimAutomation.HorizonView) can be used to Connect
and Disconnect
to the View API Service to assist with automating Horizon activities via Powershell.
The Omnissa.Horizon.Helper Powershell Module extends the capabilities provided by the Omnissa.VimAutomation.HorizonView
module. It can Add, create New, Get, Set, Start and Remove Global, Farm and Pool settings.
Using Horizon Powercli¶
- Download the Omnissa.VimAutomation.HorizonView module and follow the installation steps
- Import HorizonView module by running:
Import-Module Omnissa.VimAutomation.HorizonView.
- Import "Omnissa.Horizon.Helper" module by running:
Import-Module -Name Omnissa.Horizon.Helper
. Alternatively runGet-Module -ListAvailable 'Omnissa.Horizon.Helper' | Import-Module
. - Run
Get-Command -Module 'Omnissa.Horizon.Helper'
to list all available functions.
Getting Started with Omnissa Horizon cmdlets¶
Cmdlets are usually implemented around resource operations. The four basic operations are CREATE, READ, UPDATE and DELETE. This set of operations is known as CRUD. Most of the cmdlets support CRUD which are respectively cmdlets that start with the New/Get/Set/Remove cmdlet verbs but they also may have additional operations.
Omnissa.VimAutomation.HorizonView module provides two commandlets:
Connect-HVServer
This cmdlet establishes a connection to the Horizon API service that runs on an instance of the Horizon Connection server.Disconnect-HVServer
This cmdlet closes the connection to one or more Horizon API services that run on one or more instances of Horizon Connection servers.
Omnissa.Horizon.Helper Powershell Module module provides many additional commandlets which are linked in the menu to the left.
Example Scripts¶
Example script to connect ViewAPI service¶
Import-Module Omnissa.VimAutomation.HorizonView
# Connection to view API service
$hvServer = Connect-HVServer -server <connection server IP/FQDN>
$hvServices = $hvserver.ExtensionData
# List Connection Servers
$csList = $hvServices.ConnectionServer.ConnectionServer_List()
Use advanced functions of this module¶
New-HVPool -spec 'path to InstantClone.json file'