Do you wonder sometime, that how much time you script it taking to complete, or, when you have started the script and then it finished.
I love to see it, and I use a very simple way to monitor it.
The trick is to create a variable in the first live on the script and save the Get-Date info, and in the end of the script create another variable and save the same Get-Date information to it , and then minus the start date variable with the end date and Voila! you will get the information.
$startTime = Get-date
Get-ChildItem c:\
$endTime = Get-Date
$endTime - $startTime
Thanks for your time.
Regards.
Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube” channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.
Measure-Command?
ReplyDeleteYup, we can use that too :) , it's just an another way to do it ;)
DeleteThis comment has been removed by a blog administrator.
ReplyDeleteMeasure-Command {ls c:}
ReplyDelete