From ea4c9d5acd1eff911c0e5ed69eb0d3ad566f8b75 Mon Sep 17 00:00:00 2001 From: simeononsecurity <4913771+simeononsecurity@users.noreply.github.com> Date: Thu, 31 Mar 2022 02:28:48 +0000 Subject: [PATCH] Update windows11.ps1 --- windows11.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/windows11.ps1 b/windows11.ps1 index 54dea1e..a20e67e 100644 --- a/windows11.ps1 +++ b/windows11.ps1 @@ -474,4 +474,10 @@ Start-Job -Name "Configuring Windows - Optimizations, Debloating, and Hardening" New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "BranchReadinessLevel" -Value 2 -Force New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ManagePreviewBuilds" -Value 1 -Force New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ManagePreviewBuildsPolicyValue" -Value 2 -Force + + + #Auto Update Choco Packages + $Sta = New-ScheduledTaskAction -Execute "powershell -Command 'choco upgrade all'" + $Stset = New-ScheduledTaskSettingsSet -RunOnlyIfNetworkAvailable -RunOnlyIfIdle -IdleDuration 00:02:00 -IdleWaitTimeout 02:30:00 -ExecutionTimeLimit (New-TimeSpan -Hours 1) -DontStopOnIdleEnd -WakeToRun + Register-ScheduledTask Task02 -Action $Sta -Settings $Stset }