Skip to content
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

20 lines (17 sloc) 770 Bytes
param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 1)]
Start-Transcript -Path $(Join-Path $env:TEMP "InstallFont.log")
Write-Output "Font file '$FontFileName' passed as argument"
Write-Output "Copying item to: '$("$env:windir\Fonts\$FontFileName")'"
Copy-Item -Path "$PSScriptRoot\$FontFileName" -Destination "$env:windir\Fonts" -Force -PassThru -ErrorAction Stop
Write-Output "Creating item: 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\$FontFileName'"
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" -Name $FontFileName -PropertyType String -Value $FontFileName -Force
Write-Error $_
You can’t perform that action at this time.