Created
October 30, 2018 14:01
-
-
Save markhallen/a65b02c56dcde9c07e4ba493c6a55600 to your computer and use it in GitHub Desktop.
Install font files in Windows 10. Font files should be in the same folder as the script file.
This file contains 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 characters
$shell = New-Object -ComObject Shell.Application | |
foreach ($font in $shell.Namespace($PSScriptRoot).Items()) { | |
if (($font.Path).ToLower() -like "*.ttf" -or ($font.Path).ToLower() -like "*.otf" -or ($font.Path).ToLower() -like "*.ttc") { | |
if (-not (Test-Path ($env:windir + "\Fonts\" + $font.Path.Split("\")[-1]) -ErrorAction SilentlyContinue)) { | |
$font.InvokeVerbEx("Install") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment