From 06adb1b55e8b91e5362c7560150ddbd8a541c8b2 Mon Sep 17 00:00:00 2001 From: Danny de Kooker Date: Mon, 3 Feb 2025 09:40:54 +0100 Subject: [PATCH] Changed the services lookup to allow wildcards --- .../Win - Automatic Services and remidiation.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Check_scripts/Win - Automatic Services and remidiation.ps1 b/Check_scripts/Win - Automatic Services and remidiation.ps1 index d51efa8..8e59379 100644 --- a/Check_scripts/Win - Automatic Services and remidiation.ps1 +++ b/Check_scripts/Win - Automatic Services and remidiation.ps1 @@ -25,11 +25,17 @@ .CHANGELOG 24-06-2022 - Initial script. 26-06-2022 - Added remediation to start stopped services + 03-02-2025 - Changed the services lookup to allow wildcards #> #region Parameters, functions and global variables - $VAR_Excludes = "edgeupdate","RemoteRegistry","sppsvc","MapsBroker","gupdate","TrustedInstaller" - $Services = Get-Service | Where-Object { $_.Name -notin $VAR_Excludes -and $_.StartType -eq "Automatic" -and $_.Status -ne "Running" } + $VAR_Excludes = @("edgeupdate","RemoteRegistry","sppsvc","MapsBroker","gupdate","TrustedInstaller","GoogleUpdater*") + + $Services = Get-Service | Where-Object { + ($_.Name -notmatch ($VAR_Excludes -join "|")) -and + ($_.StartType -eq "Automatic") -and + ($_.Status -ne "Running") + } #endregion #region script if (!($Services)) {