From 0f15be36f37054f1455a9aeb17fe32caccc0c024 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:58:40 +0200 Subject: [PATCH] Move winget_system_apps.txt to \config folder --- .../Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 | 2 +- Sources/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 | 2 +- .../Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 b/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 index bb1142a..e0f9284 100644 --- a/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 @@ -68,7 +68,7 @@ function Get-WingetOutdatedApps { #If current user is not system, remove system apps from list if ($IsSystem -eq $false) { - $SystemApps = Get-Content -Path "$WorkingDir\winget_system_apps.txt" -ErrorAction SilentlyContinue + $SystemApps = Get-Content -Path "$WorkingDir\config\winget_system_apps.txt" -ErrorAction SilentlyContinue $upgradeList = $upgradeList | Where-Object { $SystemApps -notcontains $_.Id } } diff --git a/Sources/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 b/Sources/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 index 8f653ea..261bbd5 100644 --- a/Sources/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 @@ -1,7 +1,7 @@ function Get-WingetSystemApps { #Json File, where to export system installed apps - $jsonFile = "$WorkingDir\winget_system_apps.txt" + $jsonFile = "$WorkingDir\config\winget_system_apps.txt" #Get list of installed Winget apps to json file & $Winget export -o $jsonFile --accept-source-agreements -s winget | Out-Null diff --git a/Sources/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 b/Sources/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 index fa3db58..00eb446 100644 --- a/Sources/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 @@ -101,7 +101,9 @@ function Invoke-PostUpdateActions { "$WorkingDir\functions\Write-Log.ps1", "$WorkingDir\functions\Get-WinGetAvailableVersion.ps1", "$WorkingDir\functions\Invoke-ModsProtect.ps1", - "$WorkingDir\Version.txt" + "$WorkingDir\functions\Write-CMTraceLog.ps1", + "$WorkingDir\Version.txt", + "$WorkingDir\winget_system_apps.txt" ) foreach ($FileName in $FileNames) { if (Test-Path $FileName) {