Anlage des Repos
This commit is contained in:
31
knowlegbase/XML Händling/xmltest.ps1
Normal file
31
knowlegbase/XML Händling/xmltest.ps1
Normal file
@@ -0,0 +1,31 @@
|
||||
#[void] remove-variable * | out-null
|
||||
|
||||
<#
|
||||
|
||||
[xml]$LISFile = get-content e:\vorlage1.xml
|
||||
|
||||
#Beispiel:
|
||||
$LISFile.tour.tour_date
|
||||
|
||||
#>
|
||||
|
||||
$xml = New-Object XML
|
||||
$xml.Load("e:\Vorlage3.xml")
|
||||
#$xml
|
||||
|
||||
$oldperson = @($xml.employees.employee)[0]
|
||||
$oldperson
|
||||
|
||||
|
||||
|
||||
$newperson = $oldperson.Clone()
|
||||
$newperson.name = "Cofi"
|
||||
$newperson.age = "30"
|
||||
$newperson.id = "103"
|
||||
|
||||
$xml.employees.AppendChild($newperson)
|
||||
|
||||
write-host "---------------"
|
||||
$xml
|
||||
|
||||
$xml.Save("e:\Vorlage3.xml")
|
||||
Reference in New Issue
Block a user