I have a Windows 2008 R2 server with Powershell V4.0
I got a very simple script test.ps1 with this content :
Write-host "Hello world!"
I call this script from a powershell prompt like this :
measure-command { powershell.exe -file .\test.ps1 }
I got extremely high value as you can see :
Days : 0
Hours : 0
Minutes : 0
Seconds : 7
Milliseconds : 992
Ticks : 79922815
TotalDays : 9,25032581018519E-05
TotalHours : 0,00222007819444444
TotalMinutes : 0,133204691666667
TotalSeconds : 7,9922815
TotalMilliseconds : 7992,2815
Or
Days : 0
Hours : 0
Minutes : 0
Seconds : 4
Milliseconds : 655
Ticks : 46556579
TotalDays : 5,38849293981481E-05
TotalHours : 0,00129323830555556
TotalMinutes : 0,0775942983333333
TotalSeconds : 4,6556579
TotalMilliseconds : 4655,6579
And it taking my cpu at 50%. Why it's too long ? I tried with -noprofile
but it's same.
Thanks for your help.