From f9b4bf3a1770557c224d527673d80f2d6591a459 Mon Sep 17 00:00:00 2001 From: Julian Pawlowski <75446+jpawlowski@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:49:43 +0200 Subject: [PATCH] fix continuation --- src/powershell-extended/Install-NerdFont.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/powershell-extended/Install-NerdFont.ps1 b/src/powershell-extended/Install-NerdFont.ps1 index 08f64e5..7d88e90 100755 --- a/src/powershell-extended/Install-NerdFont.ps1 +++ b/src/powershell-extended/Install-NerdFont.ps1 @@ -1045,6 +1045,7 @@ process { if ($IsWindows) { $fontRegistryPath = 'HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Fonts' $fontRegistryKeys = Get-ChildItem -Path $fontRegistryPath -Recurse -ErrorAction Ignore + $fontOwnedByApp = $false foreach ($fontRegistryKey in $fontRegistryKeys) { $fontRegistryValues = $fontRegistryKey.GetValueNames() | ForEach-Object { @@ -1058,12 +1059,14 @@ process { $fontRegistryValue = $fontRegistryValues | Where-Object { $_.FileName -eq $fontFile.Name } if ($fontRegistryValue) { - Write-Verbose "Font file $($fontFile.Name) already registered by application: $($fontRegistryKey.Name)" + $fontOwnedByApp = $true continue } } } + if ($fontOwnedByApp) { continue } + $fontFileDestinationPath = [System.IO.Path]::Combine($fontDestinationFolderPath, $fontFile.Name) if (-not $Force -and (Test-Path -Path $fontFileDestinationPath)) { if ($Force) {