From da13109217443aaf0c791c9d1e0ba3306616f746 Mon Sep 17 00:00:00 2001 From: Julian Pawlowski <75446+jpawlowski@users.noreply.github.com> Date: Wed, 28 Aug 2024 18:16:45 +0200 Subject: [PATCH] fix exit --- src/powershell-extended/Install-NerdFont.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/powershell-extended/Install-NerdFont.ps1 b/src/powershell-extended/Install-NerdFont.ps1 index 167b010..8e3e65b 100755 --- a/src/powershell-extended/Install-NerdFont.ps1 +++ b/src/powershell-extended/Install-NerdFont.ps1 @@ -782,10 +782,11 @@ begin { do { $Name = Show-Menu -Options $allNerdFonts if ($Name -eq 'quit') { + $Name = $null Write-Host "Selection process canceled." if ($null -eq $MyInvocation.InvocationName -or $MyInvocation.InvocationName -eq '&') { # Running as a script block - return + break } else { # Running as a standalone script @@ -805,7 +806,6 @@ begin { } } else { - Write-Host 'No font selected.' if ($null -eq $MyInvocation.InvocationName -or $MyInvocation.InvocationName -eq '&') { # Running as a script block return @@ -1058,15 +1058,15 @@ process { } $fontRegistryValue = $fontRegistryValues | Where-Object { $_.FileName -eq $fontFile.Name } - if ($fontRegistryValue) { + if ($fontRegistryValue.Count -gt 0) { $fontOwnedByApp = $true Write-Verbose "Font file $($fontFile.Name) already registered by application: $(Split-Path -Path $fontRegistryKey.Name -Leaf)" continue } } - } - if ($fontOwnedByApp) { continue } + if ($fontOwnedByApp) { continue } + } $fontFileDestinationPath = [System.IO.Path]::Combine($fontDestinationFolderPath, $fontFile.Name) if (-not $Force -and (Test-Path -Path $fontFileDestinationPath)) {