From 388eb21e90d6c108df51b9158813aa76d80af5cf Mon Sep 17 00:00:00 2001 From: simeononsecurity <4913771+simeononsecurity@users.noreply.github.com> Date: Thu, 31 Mar 2022 02:28:35 +0000 Subject: [PATCH] Update windows10.ps1 --- windows10.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/windows10.ps1 b/windows10.ps1 index d96b158..afff308 100644 --- a/windows10.ps1 +++ b/windows10.ps1 @@ -463,4 +463,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 }