From a computer with an internet connection, open PowerShell (preferably as an administrator) and execute the following commands:
While adding a VMware VDI monitor using the Site24x7 PowerShell onboarding script, you may face errors related to Connect-HVServer cmdlet or missing Horizon modules. To fix such errors, follow these steps:
1. Install VMware PowerCLI module: Open PowerShell as an administrator and execute the following command:
During installation, you may be prompted to trust the repository. Type A (Yes to All) and press Enter to continue.
You should see the installation progress in a blue background at the top of the PowerShell window.
2. Set execution policy: Ensure that PowerShell is allowed to run local scripts by executing:
Set-ExecutionPolicy RemoteSigned
Confirm the policy change when prompted.
3. Verify installed modules: Check which VMware modules are currently installed:
Get-InstalledModule -Name VMware.*
Look for the VMware.VimAutomation.HorizonView module in the list. If the HorizonView module is not listed, install it using:
Install-Module -Name VMware.VimAutomation.HorizonView -Scope CurrentUser -AllowClobber
Again, you may be prompted to trust the repository. Type A (Yes to All), then press Enter to continue, noting the installation progress in a blue background at the top of the PowerShell window.
4. Validate cmdlet availability: Ensure the environment is ready by executing the following command:
Get-Command Connect-HVServer -Verbose
If the Connect-HVServer cmdlet appears in the output without errors, the PowerShell environment is correctly configured for VMware Horizon.