Skip to main content

Install-Font

Description

Installs one or more fonts.

Requirements

PowerShell v5

Usage

  1. For each font to install:
    1. Get the COM object for the font's directory to enable querying the metadata.
    2. Get the Title metadata properties of the font file.
    3. If the font is an OpenType font, append '(OpenType)' to the registry property name; otherwise, append '(TrueType)'.
    4. Install the font and validate success.

Installs all found fonts located in the C:\Fonts folder:

.\\Install-Font.ps1 -Path C:\\Fonts

Installs the Times New Roman font located in the C:\Fonts folder:

.\\Install-Font.ps1 -Path C:\\Fonts\\times.ttf

Parameters

ParameterAliasRequiredDefaultTypeDescription
PathTrueStringThe path to the font file or folder of font files to install.

Output

  • .\Install-Font-log.txt
  • .\Install-Font-error.txt