Japanatron Logo

I found this awesome Windows powershell script that allows you to install fonts via the command line.  This is very convenient for mass deployment.

$ssfFonts = 0x14
$fontSourceFolder = "\\PATH\TO\FONTS"
$Shell = New-Object -ComObject Shell.Application
$SystemFontsFolder = $Shell.Namespace($ssfFonts)
$FontFiles = Get-ChildItem $fontSourceFolder
$SystemFontsPath = $SystemFontsFolder.Self.Path
$rebootFlag = $false

foreach($FontFile in $FontFiles) {
    # $FontFile will be copied to this path:
    $targetPath = Join-Path $SystemFontsPath $FontFile.Name
    # So, see if target exists...
    if(Test-Path $targetPath){
        # font file with the same name already there.
        # delete and replace.
        $rebootFlag = $true
        Remove-Item $targetPath -Force
        Copy-Item $FontFile.FullName $targetPath -Force
    }else{
        #install the font.
        $SystemFontsFolder.CopyHere($FontFile.fullname)
    }
}

#Follow-up message
if($rebootFlag){
    Write-Host "At least one existing font overwritten. A reboot may be necessary."
}

Related Articles

Joomla Running on Nginx and Ub...

What follows is an outline I compiled while building an Ubuntu server for running the Joomla CMS on the Nginx web server. NOTE: Ubuntu 14.04 LTS was used for th...

Running Adobe Illustrator with...

Here's a quick one.  I've been struggling with getting Adobe Illustrator (Creative Cloud) to run properly with user-level privileges.  It would often freeze and...

Linux - Specify From Address W...

I struggled a bit with figuring out how to specify the from email address when sending mail on the Linux command line.  In short, you need to use the -r option....

Safeguarding Your Digital Life

This is an outline of a presentation I delivered called "Safeguarding Your Digital Life."  It summarizes best practices to follow for keeping your online identi...