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
}
Add a comment