PSWinGlue icon indicating copy to clipboard operation
PSWinGlue copied to clipboard

`Uninstall-Font`: Add `FileName` parameter

Open yuusakuri opened this issue 5 years ago • 0 comments

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

yuusakuri avatar Apr 30 '20 05:04 yuusakuri