There are many instances when you may need to install a number of fonts to your Servers or Workstations. What better way than to use SCCM or other deployment tools to get this task done. This package contains a small powershell script that will inject any fonts you place in the fonts-to-be-installed folder. You can then add this entire AddFonts folder to create an SCCM Package.
Step 1:
Copy and save the powershell script here to a file called Install_Fonts.ps1.
$Path=".\fonts-to-be-installed"
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.Namespace($FONTS)
$Fontdir = dir $Path
foreach($File in $Fontdir) {
if(!($file.name -match "pfb$"))
{
$try = $true
$installedFonts = @(Get-ChildItem c:\windows\fonts | Where-Object {$_.PSIsContainer -eq $false} | Select-Object basename)
$name = $File.baseName
foreach($font in $installedFonts)
{
$font = $font -replace "_", ""
$name = $name -replace "_", ""
if($font -match $name)
{
$try = $false
}
}
if($try)
{
$objFolder.CopyHere($File.fullname)
}
}
}
Step 2:
In the same folder you saved the Install_Fonts.ps1, create a fonts-to-be-installed folder.
Step 3:
Copy any Windows font files into the fonts-to-be-installed folder.
Step 4:
Manually run the powershell script or use deployment tools such as Configuration Manager to deploy with the command: