Skip to main content

Remove-Font

Description

Remove one or more installed fonts.

Requirements

PowerShell v5

Usage

  1. Finds all fonts matching the passed parameter (Title or Pattern).
  2. Removes the fonts from the registry and system fonts path.
  3. Logs the success or failure of the removal for each font.

Removes the 'Josefin Sans Bold (True Type)' font.

.\Remove-Font.ps1 -Title 'Josefin Sans Bold (True Type)'  

Removes any font with 'Josefin' in the title.

.\Remove-Font.ps1 -Title '*Josefin*'  

Removes Dollie Script Personal Use (Open Type) and Josefin Sans Bold (True Type) fonts.

.\Remove-Font.ps1 -Pattern 'Dollie Script Personal Use \(Open Type\)|Josefin Sans Bold \(True Type\)'  

Removes any font with 'Dollie' or 'Josefin' in the title.

.\Remove-Font.ps1 -Pattern 'Dollie|Josefin'  

Parameters

ParameterAliasRequiredDefaultTypeDescription
TitleSemiStringThe title of the font to remove. Accepts the '*' wildcard to remove multiple matching fonts.
PatternSemiStringA regex pattern to match against the title of fonts to remove.

Output

  • .\Remove-Font-log.txt
  • .\Remove-Font-error.txt

Additional Notes

To get the list of installed system fonts, run either of the following PowerShell commands:

Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts'  
# or
Get-ChildItem -Path (New-Object -ComObject Shell.Application).Namespace(0x14).Self.Path