Created
December 28, 2015 13:44
Revisions
-
Paldom created this gist
Dec 28, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ ## gfonts.ps1 ## <# .SYNOPSIS Script that installs ttf fonts from subfolders recursively, e.g. for batch Google Font install .NOTES File Name: gfonts.ps1 Author: Domonkos Pal - [email protected] License: MIT #> # http://stackoverflow.com/questions/16023238/installing-system-font-with-powershell function InstallFont ($loc) { $FONTS = 0x14 $objShell = New-Object -ComObject Shell.Application $objFolder = $objShell.Namespace($FONTS) $objFolder.CopyHere($loc) } function DfsFontInstall ($dir) { foreach($file in Get-ChildItem $dir) { if($file.Attributes -ne 'Directory') { if ($file.Extension -eq '.ttf') { InstallFont $file.FullName; Write-Output "Font $($file.Name) has been installed."; } } else { DfsFontInstall $file.FullName; } } } DfsFontInstall;