🧬 WQL / PowerShell
Win32_Service: Filtering Services (WQL WHERE)
Shows the WQL WHERE clause syntax against Win32_Service, starting from a LIKE '%' wildcard you customize with a real search term.
ServiceFiltered.ps1
<#
.SYNOPSIS
WQL reference: filtering Services with a WHERE clause (Win32_Service).
.DESCRIPTION
WQL supports a SQL-like WHERE clause for narrowing results. This
starts from a LIKE '%' wildcard (matches everything) against
Name — replace the wildcard with a real substring to filter
for, e.g. WHERE Name LIKE '%searchterm%'.
.EXAMPLE
.\ServiceFiltered.ps1
#>
[CmdletBinding()]
param()
$wqlQuery = "SELECT Name, DisplayName, State, StartMode, Status FROM Win32_Service WHERE Name LIKE '%'"
Write-Host "WQL: $wqlQuery" -ForegroundColor DarkGray
Get-CimInstance -Query $wqlQuery | Format-Table -Property Name, DisplayName, State, StartMode, Status -AutoSize