1

Am getting the following xml output through svn diff command.

<?xml version="1.0" encoding="UTF-8"?>
<diff>
<paths>
<path
   props="none"
   kind="file"
   item="modified">SDLC\Reports\Phase1 Analysis\report_phase1_code.xls</path>
</paths>
</diff>

I only need the complete path of the file i.e. "SDLC\Reports\Phase1 Analysis\report_phase1_code.xls" through powershell. However, because of the other attributes like props, kind, etc. present in the output, I am not getting the file path value.

Powershell code written is as follows:

[xml]$XmlDoc = Get-Content -Path output.xml

foreach( $user in $XmlDoc."diff".paths) 
{ 
    Write-Host $user.path
}

Any help on this topic would be appreciated. Thanks.

1 Answer 1

1

Should just have to do this:

foreach( $user in $XmlDoc."diff".paths) 
{ 
    Write-Host $user.path.'#text'
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.