Delete attachment write action

Microsoft.SystemCenter.AlertAttachment.DeleteAttachment.WriteAction (WriteActionModuleType)

Delete attachments from a network file share.

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsMicrosoft.SystemCenter.AlertAttachment.SaveAttachmentAccount
InputTypeSystem.BaseData

Member Modules:

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

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
AttachmentDirectoryPathstring$Config/AttachmentDirectoryPath$Attachment directory pathAttachment directory path
TimeoutSecondsint$Config/TimeoutSeconds$Timeout in secondsTimeout in seconds

Source Code:

<WriteActionModuleType ID="Microsoft.SystemCenter.AlertAttachment.DeleteAttachment.WriteAction" Accessibility="Internal" RunAs="Microsoft.SystemCenter.AlertAttachment.SaveAttachmentAccount" Batching="false">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="AttachmentDirectoryPath" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeoutSeconds" type="xsd:unsignedInt"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="AttachmentDirectoryPath" Selector="$Config/AttachmentDirectoryPath$" ParameterType="string"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="WA" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction">
<ScriptName>DeleteAttachment.ps1</ScriptName>
<ScriptBody><Script>

param($attachmentDirectoryPath)

$ErrorActionPreference = "Stop"
Remove-Item $attachmentDirectoryPath -Force -Recurse

</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>AttachmentDirectoryPath</Name>
<Value>$Config/AttachmentDirectoryPath$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<StrictErrorHandling>true</StrictErrorHandling>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="WA"/>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>