From 406367b2ebc23ba1a3e07c82f0fbfba9081cc2da Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 28 Nov 2024 16:12:55 +0100 Subject: [PATCH] bugfix: force overwrite, create fonts directory --- util/windows.psm1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/windows.psm1 b/util/windows.psm1 index b78425b..566e81e 100644 --- a/util/windows.psm1 +++ b/util/windows.psm1 @@ -189,7 +189,7 @@ function InstallNerdFont # Extract contents of zip archive Write-Host "Extracting archive $source to $destination..." -ForegroundColor Cyan - Expand-Archive $source -DestinationPath $destination | Out-Null + Expand-Archive $source -DestinationPath $destination -Force | Out-Null # Install extracted fonts $fontFiles = Get-ChildItem -Path $destination -Include "*.ttf", "*.otf" @@ -213,6 +213,11 @@ function InstallFont $destination = "$env:LOCALAPPDATA\Microsoft\Windows\Fonts\" $regKey = "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Fonts" + # Create destination directory + if (-not (Test-Path $destination)) + { New-Item -ItemType Directory -Path $destination | Out-Null + } + # Get Glyph $glyph = New-Object -TypeName Windows.Media.GlyphTypeface -ArgumentList $file.FullName