mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-02-17 07:56:24 +00:00
Refactor code structure for improved readability and maintainability (#473)
* Add ToolTips to Tweaks
This commit is contained in:
24
Scripts/FileIO/ValidateAppslist.ps1
Normal file
24
Scripts/FileIO/ValidateAppslist.ps1
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user