Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

modify content of an xml

$
0
0

Hello,

I'm new to Powershell and this forum and I'm hoping somebody can help me.

I have an XML file that I need to remove the time from two lines. The date and time vary throughout the file so I cannot use a search and replace.

This is the current lines:

<field name="Assignment,StartDate">2014-03-10T09:00:00-04:00</field>
<field name="Assignment,TalentMasterFile,Transaction_Date">2013-08-05T00:00:00</field>

 

Also, at times the field may be blank and may have to skip over it if the date time is not there.

<field name="Assignment,TalentMasterFile,Transaction_Date"/>

 

This is what what I need:

<field name="Assignment,StartDate">2014-03-10</field>
<field name="Assignment,TalentMasterFile,Transaction_Date">2013-08-05</field>

 

Any advise would be appreciate it. Thanks in advance!

 


Viewing all articles
Browse latest Browse all 8583

Trending Articles