Fix for [Bug]: -WAUWhitelist doesn't work if included_apps.txt does not already exist #605

pull/619/head
KnifMelti 2024-04-25 05:19:18 +02:00
parent 1c8e6fe698
commit ffc5d6610d
1 changed files with 4 additions and 0 deletions

View File

@ -258,6 +258,10 @@ function Uninstall-App ($AppID, $AppArgs) {
function Add-WAUWhiteList ($AppID) { function Add-WAUWhiteList ($AppID) {
#Check if WAU default intall path exists #Check if WAU default intall path exists
$WhiteList = "$WAUInstallLocation\included_apps.txt" $WhiteList = "$WAUInstallLocation\included_apps.txt"
#Create included_apps.txt if it doesn't exist
if ((Test-Path $WAUInstallLocation) -and !(Test-Path $WhiteList)) {
New-Item -ItemType File -Path $WhiteList -Force -ErrorAction SilentlyContinue
}
if (Test-Path $WhiteList) { if (Test-Path $WhiteList) {
Write-ToLog "-> Add $AppID to WAU included_apps.txt" Write-ToLog "-> Add $AppID to WAU included_apps.txt"
#Add App to "included_apps.txt" #Add App to "included_apps.txt"