dotfiles/win/Modules/Font/Font.psm1

19 lines
439 B
PowerShell
Raw Normal View History

2021-01-17 08:50:51 +00:00
function Get-Font{
[CmdletBinding()]
param(
[string] $keyword
)
[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
$families = (New-Object System.Drawing.Text.InstalledFontCollection).Families
foreach ($family in $families) {
if (-not $keyword || $family.Name.Contains($keyword)) {
echo $family.Name
}
}
}
Export-ModuleMember -Function Get-Font