Hi all, I'm attempting to set the Icon for an application, but I seem to be hitting some dependency that I don't have. Any suggestions?
C:\Users\Administrator> Set-HVApplicationIcon -ApplicationName xxxx -IconPath C:\temp\xxx.png
New-Object : Cannot find type [VMware.Hv.ApplicationIconSpec]: verify that the assembly containing this type is loaded.
At C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:9294 char:13
+ $spec = New-Object VMware.Hv.ApplicationIconSpec
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
Set-HVApplicationIcon : Error in reading the icon parameters: The property 'IconSource' cannot be found on this object. Verify that the property exists and can be set.
At line:1 char:1
+ Set-HVApplicationIcon -ApplicationName xxx -IconPath C:\temp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Set-HVApplicationIcon
I've not used the Set-HVApplicationIcon cmdlet before, but does the IconPath need to be an .ico file? (.png shown in the example).
Hi. Thanks for your response. Based on the following video, .png is accepted among others. See here: Customizing VMware Horizon RDSH Application Icons - YouTube
be sure you are using the right size for the icon and with correct DPI
DPI | Small Image | Large Image |
---|---|---|
96 dpi | 16x16 pixels | 32x32 pixels |
120 dpi | 20x20 pixels | 40x40 pixels |
144 dpi | 24x24 pixels | 48x48 pixels |
192 dpi | 32x32 pixels | 64x64 pixels |
Upgrade the powercli version to 6.5.1.6.
If you have installed powercli version 6.5.release 1 through windows installer then uninstall the current powercli from Add/Remove programs and follow the below steps..
If you are running Powershell version 5.x, run the command
Install-Module -Name VMware.PowerCLI –Scope CurrentUser
This will upgrade the powercli modules.
If you are running PowerShell version 4.x or 3.x:
1. Install a current version of PowerShellGet through one of the following two options:
1a. Install Windows Management Framework 5.1
1b. Install PackageManagement PowerShell Modules
2. Run the following command:
Install-Module -Name VMware.PowerCLI –Scope CurrentUser
3. If asked to update ‘NuGet Provider’, choose ‘Y’ to install and import the newer version.
4. If asked to ‘install modules from an untrusted repository’, choose ‘Y’ to accept.
After the upgrade run the set-HVApplicationIcon
Faced with the same problem,too
It turns out that you need at least PowerCli 6.5U2 or later.
Make sure you got the right version!!!
FYI:VMware PowerCLI 10.0.0 - VMware {code}
You can install through powerShell command,no install package needed.
That video is actually incorrect. As of Horizon 7.5, .png is the only icon type that works across all clients and features. For example, if you use .ico, Android clients won't display the launch item properly and Windows clients won't generate shortcuts correctly to the Start Menu or Desktop. I am working on an internal request to have the script error out when using unsupported icon formats, as it is very confusing right now.