Remove-Font
Description
Remove one or more installed fonts.
Requirements
PowerShell v5
Usage
- Finds all fonts matching the passed parameter (Title or Pattern).
- Removes the fonts from the registry and system fonts path.
- 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
Parameter | Alias | Required | Default | Type | Description |
---|---|---|---|---|---|
Title | Semi | String | The title of the font to remove. Accepts the '*' wildcard to remove multiple matching fonts. | ||
Pattern | Semi | String | A 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