Need To Add System Data and Time to My Powershell Test-NetConnection Output as a Column

后端 未结 1 571
不思量自难忘°
不思量自难忘° 2021-01-27 20:15

For my current script (appended below), I need to add an extra column as \'Time\' which captures the current system date and time along with the output which the script is alrea

相关标签:
1条回答
  • 2021-01-27 20:29

    If you specify date format as: dd/MM/yyyy, slash will be recognized as date separator and replaced by date separator from your current culture settings. In my case it would return 06-04-2020

    To circumvent this behaviour, escape the separators. Add this to hashtable you use for generating other properties:

    Time = (get-date -Format 'dd\/MM\/yyyy hh:mm')
    
    0 讨论(0)
提交回复
热议问题