diff --git a/install/ExtractPrograms.ps1 b/install/ExtractPrograms.ps1
index b1587ea9e052d9b9810f02a92bccefcca067ed87..3357f15ca8a20da07fb72e34311ca3a642cb1392 100644
--- a/install/ExtractPrograms.ps1
+++ b/install/ExtractPrograms.ps1
@@ -103,11 +103,9 @@ function GetApplicationName {
         [string]$exePath
     )
 
-    if ((Get-Item $exePath).VersionInfo.FileDescription) {
-        # Remove leading/trailing whitespace and replace multiple spaces with a single space.
+    try {
         $productName = (Get-Item $exePath).VersionInfo.FileDescription.Trim() -replace '\s+', ' '
-    } else {
-        # Get the executable file name without the file extension.
+    } catch {
         $productName = [System.IO.Path]::GetFileNameWithoutExtension($exePath)
     }
 
@@ -125,10 +123,7 @@ function GetUWPApplicationName {
 
     # Query the application executable for the application name.
     if (Test-Path $exePath) {
-        if ((Get-Item $exePath).VersionInfo.FileDescription) {
-            # Remove leading/trailing whitespace and replace multiple spaces with a single space.
-            $productName = (Get-Item $exePath).VersionInfo.FileDescription.Trim() -replace '\s+', ' '
-        }
+        $productName = GetApplicationName -exePath $exePath
     }
 
     # Use the 'DisplayName' (if available) if the previous method failed.