Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

PoweShell Get-Content Script to read a text file comparing data and time

Avatar of demichel
demichelFlag for United States of America asked on
Powershell
9 Comments1 Solution784 ViewsLast Modified:
I have this powershell command that read a text file for Quickbook Web Connector log and search for a specific text "No data to exchange for the application"  :

Output command:

PS C:\Users\ch> Get-Content C:\Users\ch\Documents\test.txt | select-string "No data to exchange for the application"| Se
lect-Object -last 1

20140801.15:14:14 UTC    : QBWebConnector.WebServiceManager.DoUpdateSelected() : No data to exchange for the
application:  www.abc.com - QB Financial Web Connector
---------------------------------------------------------------------------------------------------------------------------------------------------------
I need to create a script that run every 3 Hours and compare the date and time if the last result was 3 Hours from the current time and send an email like an alert.

For Example:

The script need to check for the last result " See output above"  date and time "20140801.15:14:14 UTC....."  with the current time (when the script run) 20140801.18:14:14 and if it's more than > 3 Hours send an email with the results with the output .

Let me know if this is possible.

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Subash Sundharan
Subash SundharanFlag of India imageIT Infrastructure Architect

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answers