Deploy fonts using PSAppDeployTookit trough Microsoft Endpoint Manager

1 minute read

Deploy fonts using PSAppDeployTookit through Microsoft Endpoint ManagerA short manual about deploying fonts to end-user devices using Microsoft Endpoint Manager and PSAppDeployToolkit.

A couple of weeks ago I received a question from my colleague about how to deploy fonts to end-user devices using Microsoft Endpoint Manager (Intune).

Earlier, I saw multiple posts on how to do this using simple PowerShell scripts. Of course - that can be done this way, but I decided to learn how to use PSADT in different cases.

So what I have done?

PSADT part

  • I downloaded a package from a GitHub page, copy files from the “Toolkit” folder to my work folder.
  • In the Deploy-application.ps1 file I changed information in the VARIABLE DECLARATION section to information about my package.
  • I copied necessary fonts to SupportFiles folder
  • Next thing, was removing the default installation prompt because in this case, I don’t need it.
Show-InstallationWelcome -CloseApps 'iexplore' -AllowDefer -DeferTimes 3 -CheckDiskSpace -PersistPrompt
  • Now we need to install fonts, I will show you which code I created for that purpose:
        $fonts = Get-ChildItem -Path $dirSupportFiles
        foreach ($font in $fonts) {
            Copy-File -Path "$dirSupportFiles\$($font.name)" -Destination "$envWindir\Fonts\$($font.name)"
            if ($font.Extension -eq ".ttf") {
                $fontType = "TrueType"
            }
            else {
                $fontType = "OpenType"
            }

            Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Fonts' -Name "$($font.baseName) $($fontType)" -Value $font.name -Type String
        }

Code is very simple - get all fonts from the SupportFiles folder, copy them to the Fonts folder and register it in the registry

  • From PSADT it’s is everything. We don’t need to do anything else.

Microsoft Win32 Content Prep Tool

1) You need to pack the earlier created package to the .intunewin file. The whole process I described here.

MEM part

  • You need to login into the MEM portal and add a new Win32 application. Select created earlier package and provide the necessary information.
  • For Installation command use: %windir%\sysnative\windowspowershell\v1.0\powershell.exe -ExecutionPolicy Bypass -file “Deploy-Application.ps1”
  • For uninstallation command you can use: %windir%\sysnative\windowspowershell\v1.0\powershell.exe -ExecutionPolicy Bypass -file “Deploy-Application.ps1 -DeploymentType Uninstall” but in my script there is no uinstallation commands.
  • Because I’m installing it for everyone in the company, I selected System as Install behavior.
  • As detection rule I provided to check if a file with the font exists in the C:\Windows\Fonts folder.
  • In the end, I assigned as required for all devices.

How it is finally look in Installation Status?

Deploy fonts using PSAppDeployTookit through Microsoft Endpoint Manager

I’m planning more posts about PSADT because I’m in love with that software.

Thanks for reading!