【发布时间】:2022-11-14 07:43:54
【问题描述】:
我有这个脚本,它返回我机器的重启时间。
有谁知道如何让输出在每个条目的新行上返回?现在,它显示在一行中并被切断。
$rebootTimes = @( get-eventlog system | where-object {$_.eventid -eq 6006} | select-object -ExpandProperty Timegenerated )$output = "" | Select-Object 'Rebooted at';$output.'Rebooted at' = $rebootTimes;Write-Output $output;
我试过使用数组,但同样适用!
【问题讨论】:
标签: powershell