Uninstalling Fonts via Intune
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!
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
This worked for me. Thank you