Hi Guys, As you know “c:\windows\dpinst.log” is updated whenever you try to install driver using dpinst.exe. I want to extract information of driver which i am installing, not the entire data. I tried the following but it is not extracting the information in correct sequence. Could you help.
The way Compare-Object works by default is that it will exhaustively search the reference object for anything in the difference object and vice versa. Adding -SyncWindow attempts to control just how exhaustive that search is. For example, if file1 contains the string Successful Install on line 5 and file2 contains the string Successful Install on line 300, it will be considered a match. -SyncWindow 0 for example would only compare line 5 to line 5 in each file.
Given the above statements, I don’t exactly understand your problem. Is the problem that Compare-Object has the correct differences but outputs them in an order that you don’t like? Or is the problem that Compare-Object seemingly doesn’t output the correct differences? If the problem is the differences, then I can only assume matches are happening elsewhere in the file that you are not considering.
How do you create the files Masterlist.log and Childlist.log? If I got it right I assume you copy the log file before and after an installation. Usually new entries in log files get added at the end. If I got it right you just have to get the line count before and after an installation and you’re almost done. Am I wrong?