title: How to display String name of task category in event log using Write-EventLog?
body: <p>So, I am attempting to write to the Windows Event Log using <code>Write-EventLog</code>.  I've compiled a CategoryMessageFile .dll and have registered it in the registry.  </p>
  
  <p>My script writes to the event log for the most part, but the problem is that the event doesn't display the category name; it displays the category message id enumerated in the dll.</p>
  
  <pre>
  New-EventLog -LogName Application -Source 'test1' -CategoryResourceFile 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\test.dll'
  
  Write-EventLog -LogName Application -Source 'test1' -EntryType Information -EventId 1 -Message "$($DataSet.Tables[0].Rows[$i][6])" -Category 1
  </pre>
  
  <p>I know the mapping is correct because when I run</p>
  
  <pre>
  Get-EventLog -LogName Application -Newest 3 | Format-List
  </pre>
  
  <p>The correct Category name shows up under Category for the events I had just written to the log.</p>
  
  <p>Here is what my mc file looked like.</p>
  
  <pre><code>;// Header
  
  
  ;// Categories
  MessageIdTypedef=WORD
  
  MessageId=0x1
  Language=English
  ETLUncategorizedError
  .
  
  MessageId=0x2
  Language=English
  ETLThresholdExceeded
  .
  
  MessageId=0x3
  Language=English
  ETLMalformattedFile
  .
  
  MessageId=0x4
  Language=English
  ETLWebInvocationFailure
  .
  </code></pre>
  
  <p>So, how do I get the name to display instead of the number in the event log?</p>