我可以知道如何將此腳本正確導出爲CSV?如何使用Powershell正確導出爲CSV
Try {
Invoke-Command -scriptblock {Get-EventLog System -After "7/8/2017" -Before "07/28/2017" |
Where-Object {$_.EventID -eq "50" -or $_.EventID -eq "51" -or $_.EventID -eq "55" -or $_.EventID -eq "57" -or $_.EventID -eq "6008"} |
FT -Property Machinename, TimeWritten, EntryType, Source, EventID, Message -AutoSize -wrap } -computername $computer -ErrorAction Stop
}
Catch {
Write-Host $Computer "Error/RDC Problem" -ForegroundColor Red
}
你說的 「不正常」 呢?我希望Format-Csv可以輸出對象的所有屬性,而Format-Table通常會顯示一個適合屏幕的子集。 Format-Csv將採用不受屏幕寬度限制的格式,因此它可以(也應該)包含所有內容。 –