2
2
param (
3
3
[string ]$SourceDir = " src" ,
4
4
[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
6
6
)
7
7
8
8
Write-Host " Current directory: $ ( pwd) "
@@ -36,7 +36,9 @@ function Get-OfficeApp {
36
36
}
37
37
}
38
38
39
- if ($OfficeApp -ieq " automatic" ) {
39
+ if ($OfficeAppName -ieq " automatic" ) {
40
+
41
+ Write-Host " Automatic detection of Office applications based on file extensions"
40
42
41
43
# Create a list of Office applications that are needed based on the file extensions of the folders
42
44
foreach ($folder in $folders ) {
@@ -55,7 +57,7 @@ if ($OfficeApp -ieq "automatic") {
55
57
56
58
} else {
57
59
# We parse the OfficeApp parameter to get the name of the Office application
58
- $officeApps = $OfficeApp -split " ,"
60
+ $officeApps = $OfficeAppName -split " ,"
59
61
$officeApps = $officeApps | ForEach-Object { $_.Trim () }
60
62
$officeApps = $officeApps | Where-Object { $_ -in @ (" Excel" , " Word" , " PowerPoint" , " Access" ) }
61
63
if ($officeApps.Count -eq 0 ) {
@@ -103,7 +105,7 @@ foreach ($folder in $folders) {
103
105
104
106
$fileExtension = $folder.Substring ($folder.LastIndexOf (' .' ) + 1 )
105
107
106
- if ($OfficeApp -ieq " automatic" ) {
108
+ if ($OfficeAppName -ieq " automatic" ) {
107
109
$app = Get-OfficeApp - FileExtension $fileExtension
108
110
} elseif ($officeApps.Count -eq 1 ) {
109
111
$app = $officeApps [0 ]
0 commit comments