Changed the services lookup to allow wildcards
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user