Merge pull request #254 from PARAMESHO/master

Set-HVApplicationIcon not behaving correctly with .ico and .bmp files
This commit is contained in:
Kyle Ruddy
2019-01-03 16:16:10 -05:00
committed by GitHub

View File

@@ -9319,6 +9319,16 @@ function Set-HVApplicationIcon {
} }
process { 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 { try {
$appInfo = Get-HVQueryResult -EntityType ApplicationInfo -Filter (Get-HVQueryFilter data.name -Eq $ApplicationName) -HvServer $HvServer $appInfo = Get-HVQueryResult -EntityType ApplicationInfo -Filter (Get-HVQueryFilter data.name -Eq $ApplicationName) -HvServer $HvServer
} catch { } catch {
@@ -9332,11 +9342,6 @@ function Set-HVApplicationIcon {
break break
} }
if (!(Test-Path $IconPath)) {
Write-Error "File:[$IconPath] does not exists"
break
}
$spec = New-Object VMware.Hv.ApplicationIconSpec $spec = New-Object VMware.Hv.ApplicationIconSpec
$base = New-Object VMware.Hv.ApplicationIconBase $base = New-Object VMware.Hv.ApplicationIconBase