Powershell to read text file
Posted on 2011-04-20
We use a different method to deploy patches. Everything is going well, I just need to audit the patches whether they are installed or not, so during the installation of the these patches it creates 2 files in C:\Installs\Patches folder. The file names of these files will be like this.
What I am looking is a PowerShell script, that will read the last 3rd line of KBxxxxxx.Verify.txt file.
I will provide a computers.txt with all hostnames and modules.txt with the KB article numbers, then the script should check whether the KBxxxxxx.RTInst.txt exists, if yes then should go ahead and check for KBxxxxxx.Verify.txt exists, if yes then it should read the last 3rd line of it and if the line says “Hotfix successfully installed” then write the output to a text or csv file in this fashion.