DataONTAP.Cluster.Virtualization.Discovery.WriteEventLogEntryModuleType (WriteActionModuleType)

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsDataONTAP.SecureReference.RunAsProfileVirtualization
InputTypeSystem.BaseData

Member Modules:

ID Module Type TypeId RunAs 
PowerShellWriteAction WriteAction Microsoft.Windows.PowerShellWriteAction Default

Source Code:

<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)
}

# NOTE: Event log source must already exist
Write-EventLog -LogName $LogName -Source $Source -EventId $EventId -EntryType $EntryType -Message $Message -Category $Category
}
catch
{
throw $Error
}
</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>LogName</Name>
<Value>$Data/Property[@Name='LogName']$</Value>
</Parameter>
<Parameter>
<Name>Source</Name>
<Value>$Data/Property[@Name='Source']$</Value>
</Parameter>
<Parameter>
<Name>EventId</Name>
<Value>$Data/Property[@Name='EventId']$</Value>
</Parameter>
<Parameter>
<Name>EntryType</Name>
<Value>$Data/Property[@Name='EntryType']$</Value>
</Parameter>
<Parameter>
<Name>Category</Name>
<Value>$Data/Property[@Name='Category']$</Value>
</Parameter>
<Parameter>
<Name>Message</Name>
<Value>$Data/Property[@Name='Message']$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>300</TimeoutSeconds>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="PowerShellWriteAction"/>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>