PowerShell Script Serialized Object Write Action

Microsoft.Windows.PowerShellWriteAction (WriteActionModuleType)

Use this module as a write action for running PowerShell scripts when full access is needed to both the screen output and the objects returned by the PowerShell script. This module returns data of type Microsoft.Windows.SerializedObjectData. This module should be used for implementing recoveries or as the write action for agent tasks. The SerializationDepth parameter should be set as small as possible (3 or less) to prevent the resulting data item from becoming too large. The StrictErrorHandling parameter should only be set to "true" if the module is being used in an agent task. For more information on this module and the SerializedObjectData type refer to the "Operations Manager Module Types Reference" online.

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
InputTypeSystem.BaseData
OutputTypeMicrosoft.Windows.SerializedObjectData

Member Modules:

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

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
TimeoutSecondsint$Config/TimeoutSeconds$Timeout Seconds

Source Code:

<WriteActionModuleType ID="Microsoft.Windows.PowerShellWriteAction" Accessibility="Public">
<Configuration>
<IncludeSchemaTypes>
<SchemaType>Microsoft.Windows.PowerShellSchema</SchemaType>
</IncludeSchemaTypes>
<xsd:element name="ScriptName" type="NonNullString"/>
<xsd:element name="ScriptBody" type="NonNullString"/>
<xsd:element name="SnapIns" type="SnapInsType" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Parameters" type="NamedParametersType" minOccurs="0" maxOccurs="1"/>
<xsd:element name="TimeoutSeconds" type="xsd:integer"/>
<xsd:element name="StrictErrorHandling" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="SerializationDepth" type="xsd:integer" minOccurs="0" maxOccurs="1"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation>
<Composite>
<MemberModules>
<WriteAction ID="PowerShellWriteAction" TypeID="Microsoft.Windows.PowerShellWriteActionBase">
<ScriptName>$Config/ScriptName$</ScriptName>
<ScriptBody><Script>$Config/ScriptBody$</Script></ScriptBody>
<SnapIns>$Config/SnapIns$</SnapIns>
<Parameters>$Config/Parameters$</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<OutputType>SerializedObjectData_OpsMgrSerialization</OutputType>
<StrictErrorHandling>$Config/StrictErrorHandling$</StrictErrorHandling>
<SerializationDepth>$Config/SerializationDepth$</SerializationDepth>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="PowerShellWriteAction"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>Microsoft.Windows.SerializedObjectData</OutputType>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>