Recently a customer using Microsoft Intune requested to deploy a TrueType font required by one of their line of business apps. Because Intune does not offer a native solution to deploy fonts it was quite clear that a PowerShell script or Intune Win32 app should do the trick. Note that the mentioned PowerShell scripts can also be used for app deployments with Configuration Manager (MEMCM).
How to install a font programmatically?
There seem to be multiple options depending on the operating system version. I've tested this with Windows 10 1909. And broke it down to the following steps:
- Copy the font to the "C:\Windows\Fonts" folder
- Create a registry key which points to the filename of the *.ttf font copied to the Windows font path
How to install a font with Intune?
To get the font to Windows 10 devices I created a PowerShell script which copies the the font to the windows-fonts folder and creates the required registry key. The script expects the name of your font file as command line parameter.
Deploying the PowerShell script as Intune Win32 app has the advantage that we can link the font as dependency if any app requires a specific font. Additionally we can also detect and uninstall the font if needed.
To uninstall the font I created an uninstall script which reverts the steps mentioned above.
Combining Intune Win32 apps and a PowerShell script
- Prepare a folder structure with your font and the installfont.ps1 script (available on GitHub)
2. Create a new intunewin package with the Microsoft-Win32-Content-Prep-Tool:
- Create, upload the intunewin package to Intune
- Program settings:
powershell -Ex Bypass -windowstyle Hidden -file "installfont.ps1" "RemachineScript_Personal_Use.ttf"
powershell -Ex Bypass -windowstyle Hidden -file "uninstallfont.ps1" "RemachineScript_Personal_Use.ttf"
Make sure that the file name matches the file in your intunewin package and includes the file extension
- Detection Rule:
Make sure to match the source file in your intunewin package and install command.
- Assign the app as availabe or required
On a Windows 10 machine enrolled in Intune we can now test the installation:
And find the font successfully installed:
Also note that a very basic log get's created under 'C:\Windows\Temp\InstallFont.log'.
Hoping this guide helps you to deploy font files to Windows 10 devices and save's you some time. The mentioned PowerShell scripts could also be used with Configuration Manager (MEMCM).