<WriteActionModuleType ID="DataONTAP.Cluster.Virtualization.Discovery.WriteEventLogEntryModuleType" Accessibility="Internal" Batching="false" RunAs="DS!DataONTAP.SecureReference.RunAsProfileVirtualization">
<Configuration/>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="PowerShellWriteAction" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction">
<ScriptName>WriteEventLogEntry.ps1</ScriptName>
<ScriptBody><Script>##############################################################################
# Copyright (c) 2013 NetApp.
#
# Script for writing an event log entry to the localhost given the event
# log entry parameters.
#
##############################################################################
Param($LogName, $Source, $EventId, $EntryType, $Category, $Message)
$Error.Clear()
# .Net framework documents max message length as 32765. However, it shopuld be 31839 based on below link
# https://connect.microsoft.com/VisualStudio/feedback/details/770126/eventlog-writeentry-can-corrupt-the-event-log-because-of-invalid-argument-check-in-net-framework#tabs
Set-Variable EventMessageMaxLength -Option Constant -value 31839
try
{
# Truncate the Message if message length is greater than allowed limit.
if ($Message.Length -gt $EventMessageMaxLength) {
$Message = $Message.Substring(0, $EventMessageMaxLength)
}