pull/431/head
romanitho 2023-10-17 21:09:44 +02:00
parent b8808c6584
commit bfb3a50d86
3 changed files with 7 additions and 6 deletions

View File

@ -11,11 +11,12 @@ Get-ChildItem "$WorkingDir\functions" | ForEach-Object { . $_.FullName }
#Check if running account is system or interactive logon #Check if running account is system or interactive logon
$Script:IsSystem = [System.Security.Principal.WindowsIdentity]::GetCurrent().IsSystem $Script:IsSystem = [System.Security.Principal.WindowsIdentity]::GetCurrent().IsSystem
#Run log initialisation function #Log initialisation
$LogFile = "$WorkingDir\logs\updates.log"
Write-ToLog -LogMsg "CHECK FOR APP UPDATES" -IsHeader Write-ToLog -LogMsg "CHECK FOR APP UPDATES" -IsHeader
#Get settings and Domain/Local Policies (GPO) if activated. #Get settings and Domain/Local Policies (GPO) if activated.
$WAUConfig = Get-WAUConfig $Script:WAUConfig = Get-WAUConfig
if ($($WAUPolicies.WAU_ActivateGPOManagement -eq 1)) { if ($($WAUPolicies.WAU_ActivateGPOManagement -eq 1)) {
Write-ToLog "WAU Policies management Enabled." Write-ToLog "WAU Policies management Enabled."
} }

View File

@ -200,10 +200,10 @@ function Invoke-PostUpdateActions {
### End of post update actions ### ### End of post update actions ###
#Reset WAU_UpdatePostActions Value #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 #Get updated WAU Config
$Script:WAUConfig = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" $Script:WAUConfig = Get-WAUConfig
#log #log
Write-ToLog "Post Update actions finished" "green" Write-ToLog "Post Update actions finished" "green"

View File

@ -41,10 +41,10 @@ function Update-WAU {
Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue
#Set new version to registry #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 #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 #Send success Notif
Write-ToLog "WAU Update completed." "Green" Write-ToLog "WAU Update completed." "Green"