Avatar of bibi92
bibi92
Flag for France asked on

get string on several files contains [

Hello,
$path = "c:\Logs"  
$Searchstring = 'Return Code' -match '^Return Code[0'


$Logs = Get-ChildItem -path $path -recurse -include *.log  

 
parsing "^Return Code[0" - Unterminated [] set.
At line:1 char:1
+ $Searchstring = 'Return Code' -match '^Return Code[0'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException

How to resolve ?

Thank you  




Powershell

Avatar of undefined
Last Comment
oBdA

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
oBdA

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.
Your help has saved me hundreds of hours of internet surfing.
fblack61