Automating the world one-liner at a time…
Per Ostergaard has an interesting blog entry HERE where he discusses the pros/cons of various options for date/time formatting for time stamping log files.
He concludes the following worked best for him:
"$(Get-Date –f o) Start logging"
Let's see what that gives us:
PS> "$(Get-Date -f o) Start logging"
2007-05-19T12:20:18.2343750-07:00 Start logging
That is a little chewy but once you get what it is doing, it is pretty cool. Check our Per's blog for the details. You can use this LINK to see all of Per's PowerShell blogs.
Jeffrey Snover [MSFT]Windows Management Partner ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx