0

I am passing $SourceFileName as studentpackage.zip and copying the zip to below two location.how to update the xml attribute configsolutionfile when there is a change in $SourceFileName

function BuildArchive          
{            
    param            
    (            
        [parameter(Mandatory=$true)]            
        [ValidateNotNullOrEmpty()]             
        [String] $SourceFileName = ""                                                    
    )  
}

D:\StudentProgram\Automate\Publishing\Content\Forums\StudentPackage contains an xml file where I need to update the attribute configsolutionfile

<?xml?>
<config>
  <solutions>
    <configsolutionfile solutionpackagefilename="studentpackage.zip" />
  </solutions>
</config>

D:\StudentProgram\Automate\Publishing\Content\Archives\StudentPackage contains an xml file where I need to update the attribute configsolutionfile

<?xml?>
<config>
  <solutions>
    <configsolutionfile solutionpackagefilename="studentpackage.zip" />
  </solutions>
</config>

1 Answer 1

2

You can do this:

[xml]$xml_contents = Get-Content 'path to XML'
$xml_contents.config.solutions.configsolutionfile.solutionpackagefilename = 'test'
$xml_contents.Save('Path to new XML')
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.