scloud icon indicating copy to clipboard operation
scloud copied to clipboard

Uninstalling Fonts via Intune

Open Nikita-zt opened this issue 3 years ago • 2 comments

Hello Florian,

Thank you for your job, it is fantastic!

Everything works fine, the only problem I have is when I try to remove fonts through Intune - it removes the fonts and registry entries, but I get the following errors (In Intune it is also marked as "Uninstall failed"):

PS>TerminatingError(Remove-Item): "A parameter cannot be found that matches parameter name 'ItemType'." Remove-Item : A parameter cannot be found that matches parameter name 'ItemType'. At C:\WINDOWS\IMECache\08964a18-e2dc-4099-9107-e4d60ad53759_1\uninstall.ps1:24 char:70

  • ... "$Path_FontsIntune\Validation$PackageName" -ItemType "file" ...
  • CategoryInfo : InvalidArgument: (:) [Remove-Item], ParameterBindingException
  • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand Remove-Item : A parameter cannot be found that matches parameter name 'ItemType'. At C:\WINDOWS\IMECache\08964a18-e2dc-4099-9107-e4d60ad53759_1\uninstall.ps1:24 char:70
  • ... "$Path_FontsIntune\Validation$PackageName" -ItemType "file" ...
  • CategoryInfo : InvalidArgument: (:) [Remove-Item], ParameterBindingException
  • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

The "Company-Fonts" file is also was not deleted from "Validation" folder.

Another thing I've noticed that the "$Version = "1" " string is missing in uninstall.ps1, or is that correct?

All help is much appreciated!

Nikita-zt avatar Oct 31 '22 13:10 Nikita-zt

Ok, it works with:

Remove-Item -Path "$Path_FontsIntune\Validation$PackageName" -Force instead of: Remove-Item -Path "$Path_FontsIntune\Validation$PackageName" -ItemType "file" -Force -Value $Version

Nikita-zt avatar Nov 03 '22 12:11 Nikita-zt

This worked for me. Thank you

tomcollis avatar May 18 '23 09:05 tomcollis