Win11Debloat/Scripts/FileIO/SaveCustomAppsListToFile.ps1
HetCreep dfe7810346
feat(registry): add GPO override warning and WhatIf dry-run previews (#611)
Co-authored-by: Jeffrey <9938813+Raphire@users.noreply.github.com>
2026-06-21 21:30:31 +02:00

21 lines
604 B
PowerShell

# Saves the provided appsList to the CustomAppsList file
function SaveCustomAppsListToFile {
param (
$appsList
)
if ($script:Params.ContainsKey("WhatIf")) {
Write-Host "[WhatIf] Save custom apps list to file" -ForegroundColor Cyan
return
}
$script:SelectedApps = $appsList
# Create file that stores selected apps if it doesn't exist
if (-not (Test-Path $script:CustomAppsListFilePath)) {
$null = New-Item $script:CustomAppsListFilePath -ItemType File
}
Set-Content -Path $script:CustomAppsListFilePath -Value $script:SelectedApps
}