Skip to content

Commit

Permalink
fix continuation
Browse files Browse the repository at this point in the history
  • Loading branch information
jpawlowski committed Aug 28, 2024
1 parent 0c786f2 commit f9b4bf3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/powershell-extended/Install-NerdFont.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down

0 comments on commit f9b4bf3

Please sign in to comment.