Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to profile(timing) in powershell

My powershell script runs slowly, is there any way to profile the powershell script?

like image 894
Daniel Wu Avatar asked Sep 18 '25 04:09

Daniel Wu


1 Answers

Posting your script here would really help in giving an accurate answer.

You can use Measure-Command to see how much time each statement in your script is taking. However, you have to wrap each statement in Measure-Command.

Trace-Command can also be used to trace what is happening when the script runs. The output from this cmdlet can be quite verbose.

http://www.jonathanmedd.net/2010/06/powershell-2-0-one-cmdlet-at-a-time-104-trace-command.html

like image 90
ravikanth Avatar answered Sep 19 '25 16:09

ravikanth