PowerShell 指令碼序列化物件寫入動作

Microsoft.Windows.PowerShellWriteAction (WriteActionModuleType)

當 PowerShell 指令碼傳回的螢幕輸出和物件都需要完整存取權時,請使用此模組作為執行 PowerShell 指令碼的寫入動作。 此模組會傳回 Microsoft.Windows.SerializedObjectData 類型的資料。 您應該使用此模組來實作復原作業,或當作代理程式工作的寫入動作。 SerializationDepth 參數的設定愈小愈好 (3 或更小),以避免產生的資料項目變得太大。 只有將此模組用於代理程式工作時,StrictErrorHandling 參數才能設成 "true"。 如需此模組與 SerializedObjectData 類型的詳細資訊,請參閱線上版<Operations Manager 模組類型參考>。

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$逾時秒數

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>