Refactor code structure for improved readability and maintainability (#473)

* Add ToolTips to Tweaks
This commit is contained in:
Jeffrey
2026-02-15 23:08:54 +01:00
committed by GitHub
parent 95dc490b6e
commit 65aabbc050
31 changed files with 2877 additions and 2813 deletions

View File

@@ -0,0 +1,24 @@
# Returns a validated list of apps based on the provided appsList and the supported apps from Apps.json
function ValidateAppslist {
param (
$appsList
)
$supportedAppsList = (LoadAppsDetailsFromJson | ForEach-Object { $_.AppId })
$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
}