Avatar of Bob
Bob
Flag for United States of America asked on

Powershell select-string

When attempting to pull all lines with, ('WilsonK21','integrate','119995
[code]

Open in new window

[/code],*'), in the same line. My results are only pulling all lines with WilsonK21.

String example below:
2020/01/27 17:04:11 pid 9464 WilsonK21@20.Q2.NSI_1_PIR82850.L xx.xxx.xxx.xxx [Helix P4V/NTX64/2019.2/1856742/v86] 'user-integrate -n //depot/MMMMM/CCC_LLLLLLL/DEVBox/LLLLLL_PPPPPPP_MMMM/...@119995,@119995 //depot/MMMMM/CCC_LLLLLLL/DEVBox/LLLLLL_PPPPPPP_MMMM/...'

$LogContent = Get-Content -Path "C:\Temp\Verify_Integrations\Resource_Files\Kelly_Integration_Main_To_Libert_INT_Helix_Log.txt"
$LogContent | Select-String -Pattern ('WilsonK21','integrate','119995') | select line | Out-File C:\Temp\Verify_Integrations\TestOutPut.txt -Width 350 -Encoding ascii

Open in new window

Powershell

Avatar of undefined
Last Comment
Bob

8/22/2022 - Mon
oBdA

Please clarify all lines with, ('WilsonK21','integrate','119995
Do you want all lines with any of these strings, or with all of them? The former works just fine.
Please provide some sample lines that were not found, even though you expected them to be.
ASKER CERTIFIED SOLUTION
footech

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Bob

ASKER
Thank you. Exactly what I was looking for.
Your help has saved me hundreds of hours of internet surfing.
fblack61