title: get-winevent: Property Field filled with System.String[] after removing descriptional content parts
body: <p>I'm trying to filter event-logs, which works fine except for the message field within the query. The message field has a lot of descriptive text in it. I only want the first sentence of it, because this is the important one, the rest is garbage. </p>
  
  <p>Example content of a message-field:</p>
  
  <pre><code>An account was successfully logged on.
  
  Subject:
      Security ID:  SYSTEM
      Account Name:  WIN-R9H529RIO4Y$
      Account Domain:  WORKGROUP
      Logon ID:  0x3e7
  Logon Type:10
  New Logon:
         Security ID:  WIN-R9H529RIO4Y\Administrator
      Account Name:  Administrator
      Account Domain:  WIN-R9H529RIO4Y
      Logon ID:  0x19f4c
      Logon GUID:  {00000000-0000-0000-0000-000000000000}
  Process Information:
     Process ID:  0x4c0
      Process Name:  C:\Windows\System32\winlogon.exe
  Network Information:
       Workstation Name: WIN-R9H529RIO4Y
      Source Network Address: 10.42.42.211
      Source Port:  1181
  Detailed Authentication Information:
       Logon Process:  User32 
      Authentication Package: Negotiate
      Transited Services: -
     Package Name (NTLM only): -
     Key Length:  0
  
  This event is generated when a logon session is created. It is generated on the computer that was accessed.
  
  The subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.
  
  The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).
  
  The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.
  
  The network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.
  
  The authentication information fields provide detailed information about this specific logon request.
  
  
  The authentication information fields provide detailed information about this specific logon request.
  •Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.
  •Transited services indicate which intermediate services have participated in this logon request.
  •Package name indicates which sub-protocol was used among the NTLM protocols.
  •Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
  </code></pre>
  
  <p>I only want "An account was successfully logged on."</p>
  
  <p>What I've tried already (and failed):</p>
  
  <pre><code>Get-WinEvent -FilterHashtable @{Path="c:\temp\export.evtx";} |
      Where-Object {($_.id -eq "4624" -and $_.properties[8].value -in 2,3,10) -or ($_.id -eq "4625") -or ($_.id -eq "4800")} |
          ForEach-Object{
              $SelectorStrings = [string[]]@(
              'Event/EventData/Data[@Name="TargetUserName"]',
              'Event/EventData/Data[@Name="TargetDomainName"]',
              'Event/EventData/Data[@Name="TargetLogonId"]',
              'Event/EventData/Data[@Name="LogonType"]',
              'Event/EventData/Data[@Name="WorkstationName"]',
              'Event/EventData/Data[@Name="IpAddress"]',
              'Event/EventData/Data[@Name="IpPort"]'
              )
              $PropertySelector = [System.Diagnostics.Eventing.Reader.EventLogPropertySelector]::new($SelectorStrings)
  
              $UserName,$Domain,$LogonId,$LogonType,$ComputerName,$IPAddress,$Port = $_.GetPropertyValues($PropertySelector)
  
              [PSCustomObject]@{
              TimeCreated  = $_.TimeCreated
              UserName     = $UserName
              Domain       = $Domain
              LogonId      = $LogonId
              LogonType    = $LogonType
              ComputerName = $ComputerName
              IPAddres     = $IPAddres
              Port         = $Port
              Message      = ($_.Message).split(".")       
              }|Export-Csv -NoTypeInformation -Force -Encoding UTF8 -Path 'c:\temp\exportencoding2.csv' -Append      
          }
  </code></pre>
  
  <p>The Result is:</p>
  
  <pre><code>"TimeCreated","UserName","Domain","LogonId","LogonType","ComputerName","IPAddres","Port","Message"
  "04.12.2017 13:56:34","Testuser","lab.internal",,"7","AssetWin7PC","127.0.0.1","0","System.String[]"
  </code></pre>
  
  <p>The Output is "System.String[]" then but it should be the first sentence. </p>