Skip to content

Commit 81ab920

Browse files
committed
Fix single array element bug
1 parent 57a5048 commit 81ab920

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Main.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ foreach ($folder in $folders) {
110110
if ($OfficeAppDetection -ieq "automatic") {
111111
$app = Get-OfficeApp -FileExtension $fileExtension
112112
} elseif ($officeApps.Count -eq 1) {
113-
$app = $officeApps[0]
113+
# Note that when an array has only one element, PowerShell will treat it as a single value
114+
$app = $officeApps
114115
} elseif ($officeApps.Count -gt 1) {
115116
Write-Host "Multiple Office applications specified. Please specify only one."
116117
exit 1

0 commit comments

Comments
 (0)