PoshCode Archive  Artifact [2620c1f988]

Artifact 2620c1f988eb3534595b61eb151a3d52dbbc0cacba5c887c0a093622d6cb58b4:

  • File Install-TempFont.ps1 — part of check-in [799b3bfa75] at 2018-06-10 14:16:44 on branch trunk — Temporarily (until restart) makes a font available without needing to install it (and thus, without need for admin rights). (user: Joel Bennett size: 617)

# 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) }