From 5620deecef3caffc70b821f3be2d6aceeef2de41 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sun, 17 Jan 2021 16:50:51 +0800 Subject: [PATCH] [feature] Get-Font --- win/Modules/Font/Font.psm1 | 18 ++++++++++++++++++ win/profile.ps1 | 1 + 2 files changed, 19 insertions(+) create mode 100644 win/Modules/Font/Font.psm1 diff --git a/win/Modules/Font/Font.psm1 b/win/Modules/Font/Font.psm1 new file mode 100644 index 0000000..7a706d2 --- /dev/null +++ b/win/Modules/Font/Font.psm1 @@ -0,0 +1,18 @@ + +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 + diff --git a/win/profile.ps1 b/win/profile.ps1 index 5c70518..3ff7b0e 100644 --- a/win/profile.ps1 +++ b/win/profile.ps1 @@ -14,6 +14,7 @@ $Env:PSModulePath += ";$Dir\Modules" $Env:KUBE_EDITOR = 'nvim' $Env:EDITOR = 'nvim' Set-Alias -Name k kubectl +Set-Alias -Name bm Open-Bookmark $isPs7 = $host.Version.Major -ge 7 if ( $isPs7 ) { Set-Prompt