I'm pretty new to Powershell and would like to output the result of a command to a file which has a timestamp. Currently I could get the date but I can't get the time. Here is what I have:
mstest /testcontainer:"C:\CodedUITests\CodedUISP.dll" /resultsfile:"C:\CodedUITests\TestResults\result $(get-date -f yyyy-MM-dd)$.trx"
How can I get the time as well?
get-dateaccepts .NET formatting strings, and you have the date - adding time is just an extension of that.