我有一个使用 get-eventlog cmdlet 提取的日志文件,这是它的输出示例:
index Time EntryType source InstanceID Message
000 xxxx error system 1111 host ip: 55.55.55.55
class: tropical
state: open
name: contractor_0001
000 xxxx error system 1111 host ip: 55.55.55.55
class: tropical
state: open
name: contractor_0002
000 xxxx error system 1111 host ip: 55.55.55.55
class: tropical
state: open
name: contractor_0003
000 xxxx error system 1111 host ip: 55.55.55.55
class: tropical
state: open
name: contractor_0004
基本上我需要文本列表中每个人的姓名,或者只使用 powershell 输出,例如:
contractor_0001
contractor_0002
contractor_0003
contractor_0004
我只需要名字,不需要其他信息。