Copy-SqlDatabase Start/Finish timing for end of migration is inaccurate
So doing migration for client yesterday, captured the output and found the ending start/completed for the whole migration process is wrong.
Database 1:
Started: 09/18/2016 07:31:06
Finished: 09/18/2016 07:45:14
Datbase 2:
Started: 09/18/2016 07:45:15
Finished: 09/18/2016 07:45:50
Database 3:
Started: 09/18/2016 07:45:50
Finished: 09/18/2016 07:46:04
Database 4:
Started: 09/18/2016 07:46:04
Finished: 09/18/2016 07:46:12
Database 5:
Started: 09/18/2016 07:46:12
Finished: 09/18/2016 07:48:13
Database 6:
Started: 09/18/2016 07:48:15
Finished: 09/18/2016 10:35:09
Database 7:
Started: 09/18/2016 10:35:09
Finished: 09/18/2016 10:35:10
Database 8:
Started: 09/18/2016 10:35:10
Finished: 09/18/2016 10:35:12
Database migration finished
Migration started: 09/18/2016 10:35:10
Migration completed: 09/18/2016 10:35:12
Total Elapsed time: 00:00:02
Total Elapsed time cannot be just 2 seconds.
it seems that in your case the total elapsed lines up with the timings for the last database. Did you use the pipeline to migrate databases or a single copy-sqldatabase command ? The only culprit I see in the current code is that the timer is started in the PROCESS block, but it should only pose an issue if using the pipeline. @wsmelton if you can confirm, I'd go moving the timer up in the BEGIN block.
Personally, and think this will be addressed in code blackout, I don't see a purpose in all the output. I don't really care how long it takes, as long as it is done.
I agree with @wsmelton I'm sure some people want to see a time output, but I think most people using the tool only want to see an error. We should hide the happy paths and other irrelevant output.
Might be good for troubleshooting though.
We now remove this information entirely and only report the current time