Merge pull request #254 from PARAMESHO/master
Set-HVApplicationIcon not behaving correctly with .ico and .bmp files
This commit is contained in:
@@ -9319,6 +9319,16 @@ function Set-HVApplicationIcon {
|
||||
}
|
||||
|
||||
process {
|
||||
if (!(Test-Path $IconPath)) {
|
||||
Write-Error "File:[$IconPath] does not exist."
|
||||
break
|
||||
}
|
||||
|
||||
if ([IO.Path]::GetExtension($IconPath) -ne '.png') {
|
||||
Write-Error "Unsupported file format:[$IconPath]. Only PNG image files are supported."
|
||||
break
|
||||
}
|
||||
|
||||
try {
|
||||
$appInfo = Get-HVQueryResult -EntityType ApplicationInfo -Filter (Get-HVQueryFilter data.name -Eq $ApplicationName) -HvServer $HvServer
|
||||
} catch {
|
||||
@@ -9332,11 +9342,6 @@ function Set-HVApplicationIcon {
|
||||
break
|
||||
}
|
||||
|
||||
if (!(Test-Path $IconPath)) {
|
||||
Write-Error "File:[$IconPath] does not exists"
|
||||
break
|
||||
}
|
||||
|
||||
$spec = New-Object VMware.Hv.ApplicationIconSpec
|
||||
$base = New-Object VMware.Hv.ApplicationIconBase
|
||||
|
||||
|
||||
Reference in New Issue
Block a user