get-winevent has no message data when using Powershell 3 ?

Answered get-winevent has no message data when using Powershell 3 ?

All Replies

  • Thursday, October 18, 2012 9:25 AM
     
      Has Code

    I am working with PowerShell v3 on 2008 R2 as well. I used the following command and got both the ID and the message:

    get-winevent -logname system -maxevents 10 | ft id,message

    Are you saying that the message field is completely empty when you execute the command on PowerShell v3?


    Jaap Brasser
    http://www.jaapbrasser.com

  • Thursday, October 18, 2012 9:31 AM
     
     
    I have the same problem on some machines.  No message field.  But I have investigated this over and over, and still can't find the reason.

    Grant Ward, a.k.a. Bigteddy

  • Thursday, October 18, 2012 10:13 AM
     
     

    Hi,

    Yes it is exactly as in the previous post from may, the "id" shows, but no "message".

    I googled something about get-winevent requires the en-US locale, I tried to switch to that but still no luck.

    Either way, when I revert back to Powershell 2 it works again, so it can't have anything to say?

  • Thursday, October 18, 2012 10:17 AM
     
     Answered

    I know there is a connect ticket open for this, have a look at it here since it seems like it is a bug:

    http://connectppe.microsoft.com/PowerShell/feedback/details/716533/get-winevent-does-not-return-the-content-of-the-event-message-in-v3-ctp2


    Jaap Brasser
    http://www.jaapbrasser.com

    • Marked As Answer by oddt Thursday, October 18, 2012 10:38 AM
    •  
  • Thursday, October 18, 2012 10:38 AM
     
     

    Okay, looks like it is...

    It says systems with the en-US locale set shouldn't be affected, I thought I could set it with set-culture, nevermind, I'll look into it.

    Anyways, thanks for help!

  • Thursday, October 18, 2012 10:05 PM
     
     Answered

    It looks like it is the issue I found (after similar symptoms from PSH v2 running under .NET4):

    https://connectppe.microsoft.com/VisualStudio/feedback/details/687408/eventrecord-formatdescription-returns-null-in-en-gb-lopcale


    Richard J Cox

  • Thursday, December 20, 2012 2:19 PM
     
      Has Code

    Confirming same on W2008R2 and Win7

    ps2

    PS C:\> Get-WinEvent -FilterHashtable @{ProviderName="Application Popup"} 
    -MaxEvents 2 -Computer SERVER1 | Select TimeCreated, Message TimeCreated Message ----------- ------- 20/12/2012 13:34:50 Application popup: P-touch Editor - ... 19/12/2012 16:52:13 Application popup: Windows - Delayed... PS C:\> $host Name : ConsoleHost Version : 2.0 InstanceId : 4ce0f3e6-2673-4537-863a-356a3861f407 UI : System.Management.Automation.Internal.Host.InternalHostUserI nterface CurrentCulture : en-GB CurrentUICulture : en-US PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy IsRunspacePushed : False Runspace : System.Management.Automation.Runspaces.LocalRunspace

    ps3

    PS C:\> Get-WinEvent -FilterHashtable @{ProviderName="Application Popup"}
    -MaxEvents 2 -Computer SERVER1 | Select TimeCreated, Message

    TimeCreated Message ----------- ------- 20/12/2012 13:34:50 19/12/2012 16:52:13 PS C:\> $host Name : ConsoleHost Version : 3.0 InstanceId : 6775fce1-1d66-4467-8c47-504d5e5667e1 UI : System.Management.Automation.Internal.Host.InternalHostUserInterface CurrentCulture : en-GB CurrentUICulture : en-US PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy IsRunspacePushed : False Runspace : System.Management.Automation.Runspaces.LocalRunspace






    • Edited by andreww Thursday, December 20, 2012 2:19 PM
    • Edited by andreww Thursday, December 20, 2012 2:38 PM
    • Edited by andreww Thursday, December 20, 2012 2:38 PM
    •