Remove variables that match from array
hi,
i have array of event log warning , stuff. want weed out ones dont care , array contains this:
epicp595.20130405.0919.12167448.o9gp.ertf: not find image '\\epicaux\letters$\geis-notagline_blk_50.jpg' specified blob server paths....
epicp595.20130405.0919.07152515.he0d.ertf: not find image '\\epicaux\letters$\geis-notagline_blk_50.jpg' specified blob server paths....
epicp595.20130405.0918.32272783.kfnh.ertf: not find image 'etximport-prod_rwb-10225542-49-55296.jpg' specified blob server paths....
epicp595.20130405.0918.31700059.8sbk.ertf: not find image 'etximport-prod_rwb-10225542-497-20150.jpg' specified blob server paths....
i remove whole line contains "geis-notagline_blk_50.jpg", trying
$test = $messages | where-object {$_ -notcontains "geis-notagline_blk_50.jpg"} $test = $messages | where-object {$_ -notlike "*geis-notagline_blk_50.jpg*"} but not luck..
any suggestions?
thanks
maybe like:
$test = @() foreach ($message in $messages) { if ($message -notlike "*geis-notagline_blk_50.jpg*") { $test += $message } } $test if find post has answered question, please mark answer. if find post helpful in anyway, please click vote helpful.
Windows Server > Windows PowerShell
Comments
Post a Comment