From 4d39a344cd9bd92e6bd4d77eefdb67e296a74888 Mon Sep 17 00:00:00 2001 From: "Michael H.G. Schmidt" Date: Sun, 29 Jan 2023 17:23:17 +0100 Subject: [PATCH] bugfixing --- optional/install-openvpn.cmd | 1 - scripts/autoconfig-all.cmd | 20 ++++++++++++++++++-- scripts/block-updates.cmd | 4 ++-- scripts/enable-updates.cmd | 10 ++++++++++ scripts/install-psupdate.cmd | 7 ++++--- 5 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 scripts/enable-updates.cmd diff --git a/optional/install-openvpn.cmd b/optional/install-openvpn.cmd index 53d8d72..a1061f6 100644 --- a/optional/install-openvpn.cmd +++ b/optional/install-openvpn.cmd @@ -25,7 +25,6 @@ del /F /Q "%PUBLIC%\Desktop\OpenVPN Connect.lnk" 2>nul echo refreshing desktop (W10 style) ... ie4uinit.exe -show -timeout /nobreak 5 echo ####### %0 ####### pause diff --git a/scripts/autoconfig-all.cmd b/scripts/autoconfig-all.cmd index c81c97a..4c61b6b 100644 --- a/scripts/autoconfig-all.cmd +++ b/scripts/autoconfig-all.cmd @@ -158,11 +158,9 @@ echo. powershell -command .\install-windowsterminal.ps1 echo. -rem fuck you microsoft ... call install-openshell.cmd echo. -rem fuck you google ... if %install_firefox% == 1 ( call install-firefox.cmd echo. @@ -201,6 +199,24 @@ echo. powershell -command .\disable-soundscheme.ps1 echo. +echo ##################### +echo ### UPDATES tasks ### +echo ##################### +echo. + +rem enable updates again ... +if %windows_updates% == 1 ( + call enable-updates.cmd + echo. +) + +rem install a powershell package for updates handling ... +call install-psupdate.cmd +echo. + +call block-updates.cmd +echo. + echo ##################### echo ### CLEANUP tasks ### echo ##################### diff --git a/scripts/block-updates.cmd b/scripts/block-updates.cmd index 55ee6b8..04a3612 100644 --- a/scripts/block-updates.cmd +++ b/scripts/block-updates.cmd @@ -7,8 +7,8 @@ echo ####### %0 ####### echo blocking UPDATE KB5005463 aka. PC-Health ... powershell -command "Hide-WindowsUpdate -KBArticleID KB5005463 -AcceptAll" -echo showing WINDOWS updates ... -powershell -command "Get-WindowsUpdate" +echo showing HIDDEN windows updates ... +powershell -command "Get-WindowsUpdate -IsHidden" echo ####### %0 ####### pause diff --git a/scripts/enable-updates.cmd b/scripts/enable-updates.cmd new file mode 100644 index 0000000..09465fe --- /dev/null +++ b/scripts/enable-updates.cmd @@ -0,0 +1,10 @@ +@echo off +set TOOLS=c:\tools + +echo ####### %0 ####### + +echo enable UPDATES for ALL users ... +%TOOLS%\wub.exe /E + +echo ####### %0 ####### + diff --git a/scripts/install-psupdate.cmd b/scripts/install-psupdate.cmd index 9833e91..a432476 100644 --- a/scripts/install-psupdate.cmd +++ b/scripts/install-psupdate.cmd @@ -4,15 +4,16 @@ if %ERRORLEVEL% neq 0 exit /b echo ####### %0 ####### -echo Installing package provider "NuGet" ... +echo Installing package provider NuGet ... powershell -command "Install-PackageProvider NuGet -Force" -echo Setting policy for "PSGallery" to "trusted" ... +echo Setting policy for PSGallery to trusted ... powershell -command "Set-PSRepository PSGallery -InstallationPolicy Trusted" -echo Installing powershell package "PSWindowsUpdate" ... +echo Installing powershell package PSWindowsUpdate ... powershell -command "Install-Module PSWindowsUpdate" echo. echo ####### %0 ####### pause +