PSWinGlue
PSWinGlue copied to clipboard
`Uninstall-Font`: Add `FileName` parameter
It would be nice to be able to specify the font to uninstall by filename. I am writing the uninstall script as follows.
$UninstallFontFileRegex = (Get-ChildItem -LiteralPath $dir -Recurse -File | Where-Object Name -Match '\.(otf|ttf)$').BaseName -join '|'
$fonts = Get-Fonts -Scope User -WarningAction Ignore
$UninstallFontName = ($fonts | Where-Object {$_.File.Name -match $UninstallFontFileRegex}).Name
Uninstall-Font -Name $UninstallFontName -Scope User