I found that I can measure execution time on Windows with this command:
Measure-Command {start-process python .\script.py -Wait}
and it works great. Unfortunately, when I try to run a script which takes some (positional and optional) arguments, I get an error message, with
Measure-Command {start-process python .\script.py file.txt 100 -Wait}
I get the error:
Start-Process : A positional parameter cannot be found that accepts argument 'file.txt'.
Without Measure-Command everything works fine.
What am I doing wrong? How to measure execution time for scripts which take arguments?
try
Measure-Command {start-process python -ArgumentList (".\script.py", "file.txt", 100) -Wait}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With