Skip to content

Instantly share code, notes, and snippets.

@matthewjberger
Created July 29, 2016 16:20
Show Gist options
  • Save matthewjberger/aeda92755012184e94033783027ddf3a to your computer and use it in GitHub Desktop.
Save matthewjberger/aeda92755012184e94033783027ddf3a to your computer and use it in GitHub Desktop.
PowerShell Font Listing
# From https://technet.microsoft.com/en-us/library/ff730944.aspx
# This will open an internet explorer window that will display all installed windows font names in their corresponding font.
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
$objFonts = New-Object System.Drawing.Text.InstalledFontCollection
$colFonts = $objFonts.Families
$objIE = New-Object -com "InternetExplorer.Application"
$objIE.Navigate("about:blank")
$objIE.ToolBar = 0
$objIE.StatusBar = 0
$objIE.Visible = $True
$objDoc = $objIE.Document.DocumentElement.LastChild
foreach ($objFont in $colFonts)
{
$strHTML = $strHTML + "<font size='5' face='" + $objFont.Name + "'>" + $objFont.Name + "</font><br>"
}
$objDoc.InnerHTML = $strHTML
# This will list all installed windows fonts
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
(New-Object System.Drawing.Text.InstalledFontCollection).Families
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment