Skip to content

Commit 40c608b

Browse files
committed
Remove list before recreating them.
To avoid mixture of both lists.
1 parent e70d961 commit 40c608b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Refresh-WingetConfiguration.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,13 @@ if ( Test-Path -Path $PolicyRegistryLocation ) {
289289
$commandLineArguments = Get-CommandLine -configuration $configuration;
290290
$commandLineArguments += " -ListPath `"$DataDir\`"" # Append path to the list file.
291291

292+
if ( Test-Path "$DataDir\excluded_apps.txt" ) {
293+
Remove-Item -Path "$DataDir\excluded_apps.txt" -Force;
294+
}
295+
if ( Test-Path "$DataDir\included_apps.txt" ) {
296+
Remove-Item -Path "$DataDir\included_apps.txt";
297+
}
298+
292299
Write-LogFile -InputObject "Configuration received from $PolicyRegistryLocation" -Severity 1;
293300
if ( Test-Path -Path $PolicyListLocation ) {
294301
$list = Get-ItemProperty -Path $PolicyListLocation;

0 commit comments

Comments
 (0)