issue with DataGrid

Welcome Forums General PowerShell Q&A issue with DataGrid

Viewing 3 reply threads
  • Author
    Posts
    • #207606
      Participant
      Topics: 18
      Replies: 29
      Points: 279
      Rank: Contributor

      hi all,

      I have this line in my script:

       $events | ForEach-Object { $dataEventLog.Rows.Add($_.Time, $_.EntryType, $_.Source, $_.Message) }

      I can see all events in my datagrid but the Time value is empty. All other columns are filled. I receive no error.

      Someone has an idea of the cause of this?

      thanks!

    • #207612
      Participant
      Topics: 5
      Replies: 321
      Points: 436
      Helping Hand
      Rank: Contributor

      I only see TimeGenerated and TimeWritten properties for this object.

       $event = Get-EventLog -Newest 1 -LogName Application
       $event | Select-Object TimeGenerated,TimeWritten,
       EntryType,Source,Message | Out-GridView
      
    • #207621
      Participant
      Topics: 18
      Replies: 29
      Points: 279
      Rank: Contributor

      interesting.

      this is what i see;

      PS C:\> Get-EventLog -Newest 1 -LogName Application

      Index Time          EntryType   Source                 InstanceID Message
      —– —-          ———   ——                 ———- ——-
      65771 Mar 03 11:38  Information SelfServicePlugIn               1 Self-service Plug-in exited.

    • #207624
      Participant
      Topics: 18
      Replies: 29
      Points: 279
      Rank: Contributor

      timegenerated does what I need.

      thanks!

Viewing 3 reply threads
  • You must be logged in to reply to this topic.