我有一个包含以下节点的Xml文件:
<Installation>
<VersionData Type="Upgrade"
</VersionData>
<DeploymentData>
<DataFileGroup enable="True">
<DataFileItem name="file2.exe.config" enable="True" installMode="Both" sourceFolder="C:\files\" distributionType="AddReplace" >
<ItemTarget featureName="AppServer" targetPaths="$targetPath/folder3;"/>
<ItemTarget featureName="WebServer" targetPaths="$targetPath/folder1;"/>
<ItemTarget featureName="DBServer" targetPaths="$targetPath;"/>
</DataFileItem>
</DataFileGroup>
</DeploymentData>
</Installation>
$xmlFile = "C:\work\myXML.xml"
$xml = [xml](Get-Content $xmlFile)
$xml.Load($xmlFile)
首先,我需要获取featureName为DBServer
的targetPaths的值。
然后,我想更改以下内容的值:
ItemTarget featureName="DBServer" targetPaths="$targetPath;"
to
ItemTarget featureName="DBServer" targetPaths="$targetPath;$concate_TargetPath"