首页 > 解决方案 > 在 powershell 字段中解析日期字符串

问题描述

我有这个字段数据,需要帮助才能从 wince 日志文件解析为正确的数据格式:

Import-Csv D:\svr\log_2021-0810_18-55-04_logcmd.txt -header Date,Ip,CMD,Command -Delimiter ':'  | foreach { 
  $_.Date + " " + $_.CMD      
}


Example Data:
599123178 10.10.10.2
599123468 10.10.10.2
599123846 10.10.10.2
599124189 10.10.10.2

我尝试使用 [DateTime]::Parse() 但无济于事。

标签: powershell

解决方案


推荐阅读