Skip to main content

Installing Fonts with PowerShell

·281 words·2 mins
system-administration tech application-packaging fonts powershell sccm sysadmin technology windows windows-10 windows-7
James Pettigrove
Author
James Pettigrove
Cloud Engineer with a focus on Microsoft Azure

Not normally the application packaging type but some time ago it fell to me to package up some open source fonts and deploy them via System Centre Configuration Manager across the enterprise. While this seems like a simple task at first, fonts are treated in a special way in Windows and we were also under strict legal instructions to comply with the open source licensing requirements of the font which were

  • User must have the license terms & conditions displayed to them prior to install
  • If the user accepts the terms & conditions, install plus deploy a copy of said terms & conditions to the endpoint

With this in mind and after a couple of trial and error bumps a long the road I came up with the below Install-Fonts.ps1 Powershell script.

To use, initiate the script from the same directory as your font(s) file together with a text document labelled LICENSEFILE.txt which contains the terms & conditions. The contents of the text file should be pasted into the following line:

## Vendor font license that will be displayed to the user for acceptence
$license = "LICENSE TEXT"

by replacing LICENSE TEXT so it is displayed to the user to allow them to accept prior to the installation kicking off. The license name and version should also be added to the Powershell script in the following line:

## Output License to user for acceptence 
$output = [System.Windows.Forms.MessageBox]::Show("$license
Do you agree to the above Terms & Conditions?"
 , "LICENSE NAME AND VERSION" , 4)

by replacing LICENSE NAME AND VERSION.

The above two elements could be made to be a bit more dynamic but hey, that’s what version 2.0 is for :)

Related

Legacy BIOS and UEFI PXE coexistence
·701 words·4 mins
system-administration tech bios dhcp powershell pxe sccm sysadmin technology uefi windows-server-2012-r2
More and more enterprises are moving towards the modern UEFI devices in their fleet, whether that be desktops, laptops or convertibles.
Export users of one AD group and import to another
·196 words·1 min
system-administration tech active-directory powershell sysadmin technology windows
It’s quite common for members of one Active Directory security group to be replicate in another.
The Group Policy Client service failed to logon - Access is denied
·157 words·1 min
system-administration tech group-policy sysadmin technology windows windows-7
Access is denied is a truly wonderful error.