Prompt Title: Install network fonts locally.

Created 1 year ago
Votes 0
Views 92 times
IT
0

Prompt Detail:

If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { $arguments = "& '" + $myinvocation.mycommand.definition + "'" Start-Process powershell -Verb runAs -ArgumentList $arguments Break } Clear-Host $ErrorActionPreference = "SilentlyContinue" $FontFolder = "\\10.251.10.251\supergsrv\HdMatte\fonts-extra\Fonts" $FontItem = Get-Item -Path $FontFolder $FontList = Get-ChildItem -Path "$FontItem\*" -Include ('*.fon','*.otf','*.ttc','*.ttf') foreach ($Font in $FontList) { Write-Host 'Installing font -' $Font.BaseName Copy-Item $Font "C:\Windows\Fonts" New-ItemProperty -Name $Font.BaseName -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Fonts" -PropertyType string -Value $Font.name }
avatar
Erez
Shared 6 prompts
Created 1 year ago

Leave a Comment