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