RSVP here: https://bit.ly/3YUS2JY
Compare File Modified Dates to Trigger Installed App Update
My goal is to create a script that downloads an MSI installer from the web and then checks both the File Modified Date of that MSI and the currently installed application EXE. Then, if the installed application File Modified Date is older, it will automatically run the MSI installer which overwrites (updates) the app.
I've got everything EXCEPT the comparison of the File Modified Dates. Downloading the MSI works. Running the installer to update/overwrite the existing install works. The gathering of the File Modified Date variables for each file works. But I, for the life of me, cannot figure out how to compare the two using Kaseya's Agent Procedure scripting. I just want to figure out "is valueA older than valueB?"
As long as the date is in format YYYYMMDD you should be able to do a simple eval() command in the Agent Procedure and then ...
IF eval (valueA is less than valueB)
PERFORM the rest of the procedure0
@ndaniel , if you can't get the eval() to work, you might need to write a PowerShell command to compare the two values and report back. BTW, make sure you are not re-inventing the wheel, be sure to look on Automation Exchange, or HTTPS://clubmsp.com to see if there is already a script to do what you want.