Skip to content

Instantly share code, notes, and snippets.

@the-nerdery-dot-info
Last active November 1, 2017 20:54
Show Gist options
  • Save the-nerdery-dot-info/df27cc297f50b8e8f07b79215f8c4304 to your computer and use it in GitHub Desktop.
Save the-nerdery-dot-info/df27cc297f50b8e8f07b79215f8c4304 to your computer and use it in GitHub Desktop.
Install fonts from network powerscript
#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