-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslss.ps1
More file actions
28 lines (23 loc) · 1.05 KB
/
slss.ps1
File metadata and controls
28 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# This function can perform sls / select-string / grep functionality on piped objects which are converted to strings
Function slss($x, $context = @(1,1))
{
foreach($a in $input)
{ $a | out-string -stream | select-string $x -context $context }
} #end function slss
<#
=======
Example:
========
PS C:\> get-service | slss ds
Stopped AppIDSvc Application Identity
Running DsmSvc Device Setup Manager
Stopped DsRoleSvc DS Role Server
Stopped hidserv Human Interface Device Access
Stopped KdsSvc Microsoft Key Distribution Service
Stopped lltdsvc Link-Layer Topology Discovery Mapper
Running LPDSVC LPD Service
Running NTDS Active Directory Domain Services
Stopped SCardSvr Smart Card
Running vds Virtual Disk
Stopped WDSServer Windows Deployment Services Server
#>