I have a folder filled with TTF files of custom fonts. I need to install them as system fonts using a powershell script (this is on Windows Server 2008 R2). Does anybody know
Just wanted to post an alternative which doesn't require 0x14
to be hard coded into the script. Pass the file object to the function, and it will just run the "Install" based on where the file is:
Function Install-Font {
Param (
[Parameter(Mandatory=$true,ValueFromPipeline=$true)][System.IO.FileSystemInfo[]]$File
)
$shell = New-Object -ComObject Shell.Application
$File | % {
$Fonts = $shell.NameSpace($_.Directory.Name)
$font = $Fonts.ParseName($_.Name)
$font.InvokeVerb("Install")
}
}