From ad38e3d18b399c7920f24afeb65e36ac88954e8c Mon Sep 17 00:00:00 2001 From: romanitho <96626929+Romanitho@users.noreply.github.com> Date: Tue, 17 Oct 2023 21:22:15 +0200 Subject: [PATCH] Fix registry modifications --- Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 | 4 ++-- Winget-AutoUpdate/functions/Update-WAU.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 b/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 index 7651c0f..89ebb80 100644 --- a/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 +++ b/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 @@ -199,10 +199,10 @@ function Invoke-PostUpdateActions { ### End of post update actions ### #Reset WAU_UpdatePostActions Value - $WAUConfig | New-ItemProperty -Name WAU_PostUpdateActions -Value 0 -Force | Out-Null + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "WAU_PostUpdateActions" -Value 0 -Force | Out-Null #Get updated WAU Config - $Script:WAUConfig = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" + $Script:WAUConfig = Get-WAUConfig #log Write-ToLog "Post Update actions finished" "green" diff --git a/Winget-AutoUpdate/functions/Update-WAU.ps1 b/Winget-AutoUpdate/functions/Update-WAU.ps1 index be415f4..035c29c 100644 --- a/Winget-AutoUpdate/functions/Update-WAU.ps1 +++ b/Winget-AutoUpdate/functions/Update-WAU.ps1 @@ -41,10 +41,10 @@ function Update-WAU { Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue #Set new version to registry - $WAUConfig | New-ItemProperty -Name DisplayVersion -Value $WAUAvailableVersion -Force | Out-Null + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "DisplayVersion" -Value $WAUAvailableVersion -Force | Out-Null #Set Post Update actions to 1 - $WAUConfig | New-ItemProperty -Name WAU_PostUpdateActions -Value 1 -Force | Out-Null + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "WAU_PostUpdateActions" -Value 1 -Force | Out-Null #Send success Notif Write-ToLog "WAU Update completed." "Green"