powershell measure-command
Hi Rubber Duck Fans:
I was going to use timeit from the 2003 resource kit and c program from
stack overflow was DNW i e did not work so we tried powershell with mixed
results.
PS C:\Scripts> set-location c:\masm32\bin
PS C:\masm32\bin> measure-command {start-process c:\masm32\bin\showtime,exe -wai
t}
Start-Process : Cannot convert 'System.Object[]' to the type 'System.String' re
quired by parameter 'FilePath'. Specified method is not supported.
At line:1 char:31
+ measure-command {start-process <<<< c:\masm32\bin\showtime,exe -wait}
+ CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterB
indingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Comma
nds.StartProcessCommand
Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 10
Ticks : 103003
TotalDays : 1.19216435185185E-07
TotalHours : 2.86119444444444E-06
TotalMinutes : 0.000171671666666667
TotalSeconds : 0.0103003
TotalMilliseconds : 10.3003
PS C:\masm32\bin>
PS C:\masm32\bin>
A couple of question the program showtime writes to the console
with the date and time in the long format similiar to get-date.
PS C:\masm32\bin>
PS C:\masm32\bin>
I am right in thinking showtime.exe did not run because two
windows should come up.
and what is PS complaining about how do we fix it?
Also note the brackets are curly brackets as in c++.
Regards Alan
February 24th, 2013 9:28pm
Hi,
The issue seems related to the script using issue. In this case, I would like suggest you post the issue to Windows Script forum for further help.
http://social.technet.microsoft.com/Forums/en/category/scripting
Regards.Spencer
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
February 26th, 2013 6:46am