Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Get-EventLog need help with date and time property.

$
0
0

Hi,

I want to know the list of date and times when my pc was last started. I used below command:

Get-EventLog -LogName system -Source Microsoft-Windows-Power-Troubleshooter -Newest 10

This shows the list of first 10 details when my pc was booted up, but when i use select-object with time property in the above command, it shows empty output, whereas index or source etc properties has data in it. I have the following questions.

 

  1. I need time(it also has date) and source properties. Time property is shown as empty. Also, if I use fl * , there are two time values, TimeGenerated and TimeWritten. what value it is taking in and converting in calculating time property. How can I acheive this?
  2. The time property shows in 24 hour format. I also want to convert to 12 hour format. 
  3. Even though I select only message property and use ft -autosize, some of the message part is not shown. I also want to see the full message.

 

Thanks,
Chaitanya. 


Viewing all articles
Browse latest Browse all 6937

Trending Articles