mikeydk
asked on
Add to XML (Powershell)
Hey
XML-file:
Powershell:
How do I add: (in the powershell part)
<employee id="123">
<name>John</name>
<status>1</status>
<salary>10000</salary> ?
</employee>
XML-file:
<Corp>
<employee id="123">
<name>John</name>
<status>1</status>
</employee>
</Corp>
Powershell:
$myfile = [xml] (Get-Content ("C:\Users\mic\Desktop\doc.xml") -Encoding UTF8)
$employees = $myfile.SelectNodes("//employee")
foreach($employee in $employees)
{
$employee.id
$employee.name
}
How do I add: (in the powershell part)
<employee id="123">
<name>John</name>
<status>1</status>
<salary>10000</salary> ?
</employee>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.