Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Hi, new to PS and I want to retrieve a substring in a Select-String

$
0
0

I am using the following command:

Select-String -Path 'c:\console.log' -pattern "cannot find user"

and it's working but I would like to trim the results to just return what's between "database" and ": Cannot".

Currently outputting:
c:\console.log:1310052:[155C:0002-1560] 11/04/2015 02:02:42 AM  SchedMgr: Error processing calendar profile document in database ARCHIVE\barmax: Cannot find user

Would like:
ARCHIVE\barmax

Any help would be great!


Viewing all articles
Browse latest Browse all 6937

Trending Articles