April 12, 2022 at 11:02 am
Are you referring to the multiple job outputs? We have a nightly process that copies previous days logs\output to a archive folder, so actually we won't get multiple outputs.
April 12, 2022 at 4:14 pm
Jeff,
Looks like your mockup is exactly what I looking for, it doesn't seem to be finding anything from match_array . Would case
have any bearing on Matches?
Thanks again for your help much apprciated.
April 12, 2022 at 4:19 pm
Yes, case is important. You can use -ilike I think.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
April 12, 2022 at 11:16 pm
I tried to goggle what you mentioned but above, but didn't find examples..
Thanks.
April 14, 2022 at 1:44 pm
When I run this code:
It pops up a message:
cmdlet Export-Csv at command pipeline position 1
Supply values for the following parameters:
InputObject:
Not sure why it's doing this..
$match_array = "error", "failed";
$folders = Get-Content "c:\temp\ListOfFolders.txt";
$folders | % {
$folder = $_;
$match_array | % {
$matched_items = Get-ChildItem $folder | Select-String -Pattern $_ | Select-Object -Property Path,LineNumber,Line;
Export-CSV "c:\temp\ErrorCapture0413.csv" -Append -NoTypeInformation;
}
}
You need to pass something to export-cdv
$matched_itrms | Export-Csv ...
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy