2026-02-15 23:08:54 +01:00
|
|
|
# Returns a validated list of apps based on the provided appsList and the supported apps from Apps.json
|
|
|
|
|
function ValidateAppslist {
|
|
|
|
|
param (
|
|
|
|
|
$appsList
|
|
|
|
|
)
|
|
|
|
|
|
2026-03-23 22:59:04 +01:00
|
|
|
$supportedAppsList = @(LoadAppsDetailsFromJson | ForEach-Object { @($_.AppId) }) | ForEach-Object { $_.Trim() } | Where-Object { $_.Length -gt 0 }
|
2026-02-15 23:08:54 +01:00
|
|
|
$validatedAppsList = @()
|
|
|
|
|
|
|
|
|
|
# Validate provided appsList against supportedAppsList
|
|
|
|
|
Foreach ($app in $appsList) {
|
|
|
|
|
$app = $app.Trim()
|
|
|
|
|
$appString = $app.Trim('*')
|
|
|
|
|
|
|
|
|
|
if ($supportedAppsList -notcontains $appString) {
|
|
|
|
|
Write-Host "Removal of app '$appString' is not supported and will be skipped" -ForegroundColor Yellow
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$validatedAppsList += $appString
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $validatedAppsList
|
|
|
|
|
}
|