PowerShell's - Get-Date cmdlet


hey guys,

super simple question!

i have basic variable in script -

$strstarttime = get-date -displayhint time
$strendtime = get-date -displayhint time

obviously - 1 grabs time @ start of script , other @ end - ready compiled in , e-mail says how long ran for. typing in console or ise on own time in format hh:mm:ss no date. excellent!

but when add variables in body of mail message, displays dd/mm/yyyy hh:mm:ss... why date of sudden? if perculiar, quite happy re-write script formatting instead of using the -displayhint argument.

thanks

bertand1

(get-date).tolongtimestring()


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Edit Group Policy

Hyper-V VM not reaching OS 'Logon' screen

DNS question...