Last active
November 1, 2017 20:54
-
-
Save the-nerdery-dot-info/df27cc297f50b8e8f07b79215f8c4304 to your computer and use it in GitHub Desktop.
Install fonts from network powerscript
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
#Font Locations | |
#Network Location | |
$NetworkPath = \\SERVER\SHARE\Fonts\ | |
#Local Location (temp place to store fonts) | |
$LocalPath= "C:\Users\Public\Fonts\" | |
$FONTS = 0x14 | |
$objShell = New-Object -ComObject Shell.Application | |
$objFolder = $objShell.Namespace($FONTS) | |
New-Item $LocalPath -type directory -Force | |
Copy-Item "$NetworkPath\*" $LocalPath | |
$Fontdir = dir $LocalPath | |
foreach($File in $Fontdir) | |
{ | |
if ((Test-Path "C:\Windows\Fonts\$File") -eq $False) | |
{ | |
$objFolder.CopyHere($File.fullname,0x10) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment