-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathInstall_Font.ps1
29 lines (22 loc) · 913 Bytes
/
Install_Font.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<#
===========================================================================
Created on: 04/07/2020 13:06
Created by: Ben Whitmore
Organization: -
Filename: Install_Font.ps1
===========================================================================
Version:
1.0
#>
#Set Current Directory
$ScriptPath = $MyInvocation.MyCommand.Path
$CurrentDir = Split-Path $ScriptPath
#Set Font Reg Key Path
$FontRegPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
#Grab the Font from the Current Directory
foreach ($Font in $(Get-ChildItem -Path $CurrentDir -Include *.ttf, *.otf, *.fon, *.fnt -Recurse)) {
#Copy Font to the Windows Font Directory
Copy-Item $Font "C:\Windows\Fonts\" -Force
#Set the Registry Key to indicate the Font has been installed
New-ItemProperty -Path $FontRegPath -Name $Font.Name -Value $Font.Name -PropertyType String | Out-Null
}