I have 2 system.array objects and I want to compare the lastmodified dates on them. I want to list rows where the name matches but the lastmodified date is over 1 hour out
The objects in question are the output from get-dbaagentjob, I’m comparing the agent job list on two nodes of a cluster and if the lastmodified dates are over an hour out I’d like it flagged.
First and foremost - please post your code (formatted as code, please). … and maybe some sample data and maybe how the expected output should look like …
You can use New-TimeSpan to calculate the difference between two [DateTime] values.
After lunch and a really good cup of tea I decided I’d just write it very basically, it’s not bringing back loads of data so I don’t need hash tables or anything.
So please, next time when you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.