# encoding: ascii
# api: powershell
# title: Install-TempFont.ps1
# description: Temporarily (until restart) makes a font available without needing to install it (and thus, without need for admin rights).
# version: 0.1
# author: Joel Bennett
# license: CC0
# x-poshcode-id: 6482
# x-archived: 2016-08-22T10:53:35
# x-published: 2016-08-20T03:24:00
#
#
add-type -name Session -namespace "" -member @"
[DllImport("gdi32.dll")]
public static extern int AddFontResource(string filePath);
"@

foreach($font in Get-ChildItem -Recurse -Include *.ttf, *.otg) { [Session]::AddFontResource($font.FullName) }
