Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rpavlik
Created July 22, 2022 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpavlik/66419a9d5854eff03112938f922e0ca1 to your computer and use it in GitHub Desktop.
Save rpavlik/66419a9d5854eff03112938f922e0ca1 to your computer and use it in GitHub Desktop.
sample powershell script to install fonts
# Note that there is actually a "fonts" bucket in scoop that makes this obsolete in this specific case
$FontRelease = "2111.01"
$FontArchive = "CascadiaCode-${FontRelease}.zip"
wget.exe "https://github.com/microsoft/cascadia-code/releases/download/v$FontRelease/$FontArchive"
# -aoa = always overwrite
7z x -oCascadiaCode -aoa "${FontArchive}"
# https://blog.simontimms.com/2021/06/11/installing-fonts/
$fonts = (New-Object -ComObject Shell.Application).Namespace(0x14)
foreach ($file in Get-ChildItem CascadiaCode\ttf\*.ttf)
{
$fn = $file.Name
if (-not (Test-Path "C:\Windows\fonts\$fn")) {
Write-Host "$fn"
Get-Item $file | %{ $fonts.CopyHere($_.fullname) }
}
}
sudo Copy-Item CascadiaCode\ttf\*.ttf c:\Windows\fonts\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment