Cisco.Ucs.Setup.PSModulePath.WriteActionModuleType (WriteActionModuleType)

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
InputTypeSystem.BaseData

Member Modules:

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

Overrideable Parameters:

IDParameterTypeSelector
Pathstring$Config/Path$
TimeoutSecondsint$Config/TimeoutSeconds$

Source Code:

<WriteActionModuleType ID="Cisco.Ucs.Setup.PSModulePath.WriteActionModuleType" Accessibility="Public" Batching="false">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="Path" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="Option" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="TimeoutSeconds" type="xsd:int"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="Path" Selector="$Config/Path$" ParameterType="string"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="PowerShellWriteAction" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction">
<ScriptName>Cisco.Ucs.Setup.PSModulePath.ps1</ScriptName>
<ScriptBody><Script>param
(
[string]$Path,
[string]$Option
)
if($option -eq "install")
{
$p = [Environment]::GetEnvironmentVariable("PSModulePath","Machine")

#Add the new path to the $p variable. Begin with a semi-colon separator.
if(-not $p.Contains(";$path"))
{
$p += ";$path"
}

#Add the paths in $p to the PSModulePath value.
[Environment]::SetEnvironmentVariable("PSModulePath",$p,"Machine")
}

if($option -eq "uninstall")
{
$p = [Environment]::GetEnvironmentVariable("PSModulePath","Machine")
$p = $p.Replace(";$path","")

[Environment]::SetEnvironmentVariable("PSModulePath",$p,"Machine")
}</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>Path</Name>
<Value>$Config/Path$</Value>
</Parameter>
<Parameter>
<Name>Option</Name>
<Value>$Config/Option$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="PowerShellWriteAction"/>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>