fix3 apps

This commit is contained in:
rmeijer_huizehetoost committed 2025-10-29 11:52:10 +01:00
1 parent 73580a419b
commit 94c6b2bb21
2 files changed
+48 -3

No files matched your search

+32 -2
View File
@@ -298,7 +298,22 @@ function Install-MedewerkersApps {
# Parse de PowerShell array uit het bestand (multiline pattern)
if ($content -match '(?s)\$apps\s*=\s*@\s*\((.*?)\)') {
$appsString = $matches[1]
$apps = $appsString -split ',' | ForEach-Object { $_.Trim().Trim('"').Trim("'") } | Where-Object { $_ -ne '' }
# Split on comma or newline, then clean up each item
$apps = @()
$lines = $appsString -split '[,\r\n]+'
foreach ($line in $lines) {
$item = $line.Trim()
# Skip empty lines
if ([string]::IsNullOrWhiteSpace($item)) { continue }
# Remove quotes from both ends (handle both single and double quotes)
$item = $item -replace '^["'']+', '' -replace '["'']+$', ''
# Remove any remaining whitespace and newlines
$item = $item.Trim().Replace("`r", '').Replace("`n", '')
# Only add if not empty
if ($item -and $item -ne '') {
$apps += $item
}
}
}
if ($apps.Count -eq 0) {
@@ -398,7 +413,22 @@ function Install-GastenApps {
# Parse de PowerShell array uit het bestand (multiline pattern)
if ($content -match '(?s)\$apps\s*=\s*@\s*\((.*?)\)') {
$appsString = $matches[1]
$apps = $appsString -split ',' | ForEach-Object { $_.Trim().Trim('"').Trim("'") } | Where-Object { $_ -ne '' }
# Split on comma or newline, then clean up each item
$apps = @()
$lines = $appsString -split '[,\r\n]+'
foreach ($line in $lines) {
$item = $line.Trim()
# Skip empty lines
if ([string]::IsNullOrWhiteSpace($item)) { continue }
# Remove quotes from both ends (handle both single and double quotes)
$item = $item -replace '^["'']+', '' -replace '["'']+$', ''
# Remove any remaining whitespace and newlines
$item = $item.Trim().Replace("`r", '').Replace("`n", '')
# Only add if not empty
if ($item -and $item -ne '') {
$apps += $item
}
}
}
if ($apps.Count -eq 0) {
+16 -1
View File
@@ -136,7 +136,22 @@ try {
# Parse the PowerShell array from the file (multiline pattern)
if ($content -match '(?s)\$apps\s*=\s*@\s*\((.*?)\)') {
$appsString = $matches[1]
$apps = $appsString -split ',' | ForEach-Object { $_.Trim().Trim('"').Trim("'") } | Where-Object { $_ -ne '' }
# Split on comma or newline, then clean up each item
$apps = @()
$lines = $appsString -split '[,\r\n]+'
foreach ($line in $lines) {
$item = $line.Trim()
# Skip empty lines
if ([string]::IsNullOrWhiteSpace($item)) { continue }
# Remove quotes from both ends (handle both single and double quotes)
$item = $item -replace '^["'']+', '' -replace '["'']+$', ''
# Remove any remaining whitespace and newlines
$item = $item.Trim().Replace("`r", '').Replace("`n", '')
# Only add if not empty
if ($item -and $item -ne '') {
$apps += $item
}
}
}
Write-Host "✓ App lijst geladen: $($apps.Count) apps gevonden" -ForegroundColor Green