Skip to content

Commit ad97e47

Browse files
committed
FIx argument name
1 parent 8e0e2c9 commit ad97e47

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Main.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
param(
33
[string]$SourceDir = "src",
44
[string]$TestFramework = "none", # Default to "none" if not specified
5-
[string]$OfficeApp = "automatic" # Default to "automatic" if not specified
5+
[string]$OfficeAppName = "automatic" # Default to "automatic" if not specified
66
)
77

88
Write-Host "Current directory: $(pwd)"
@@ -36,7 +36,9 @@ function Get-OfficeApp {
3636
}
3737
}
3838

39-
if ($OfficeApp -ieq "automatic") {
39+
if ($OfficeAppName -ieq "automatic") {
40+
41+
Write-Host "Automatic detection of Office applications based on file extensions"
4042

4143
# Create a list of Office applications that are needed based on the file extensions of the folders
4244
foreach ($folder in $folders) {
@@ -55,7 +57,7 @@ if ($OfficeApp -ieq "automatic") {
5557

5658
} else {
5759
# We parse the OfficeApp parameter to get the name of the Office application
58-
$officeApps = $OfficeApp -split ","
60+
$officeApps = $OfficeAppName -split ","
5961
$officeApps = $officeApps | ForEach-Object { $_.Trim() }
6062
$officeApps = $officeApps | Where-Object { $_ -in @("Excel", "Word", "PowerPoint", "Access") }
6163
if ($officeApps.Count -eq 0) {
@@ -103,7 +105,7 @@ foreach ($folder in $folders) {
103105

104106
$fileExtension = $folder.Substring($folder.LastIndexOf('.') + 1)
105107

106-
if ($OfficeApp -ieq "automatic") {
108+
if ($OfficeAppName -ieq "automatic") {
107109
$app = Get-OfficeApp -FileExtension $fileExtension
108110
} elseif ($officeApps.Count -eq 1) {
109111
$app = $officeApps[0]

0 commit comments

Comments
 (0)