I am looking for a way to have a powershell search through an XML doc searching for a specific ID that's within an "ID" tag, then locate the very next tag and replace it's value with "true". The IDs would be provided by the first column of a csv file. Here is an example of the XML structure:
<primary>
<main>
<id>47</id>
<desc>foobar</desc>
<indicatorflag>false</indicatorflag>
</main>
</primary>
<primary>
<main>
<id>48</id>
<desc>foobar</desc>
<indicatorflag>false</indicatorflag>
</main>
</primary>
<primary>
<main>
<id>49</id>
<desc>foobar</desc>
<indicatorflag>false</indicatorflag>
</main>
</primary>
<primary>
<main>
<id>50</id>
<desc>foobar</desc>
<indicatorflag>false</indicatorflag>
</main>
</primary>
<primary>
<main>
<id>51</id>
<desc>foobar</desc>
<indicatorflag>false</indicatorflag>
</main>
</primary>
Now imagine the csv file has, in column 1:
47
49
I would like only those indicator flag tags to be updated to true.
Any help would be very appreciated!!



