Q: edit node value in a xml files and update in a random number with powershell I wold like edit with powershell a node and update this with an random number 
xml files node
  <?xml version="1.0" encoding="utf-8" ?>
    <Configuration>
        <Other appsCode="V7{}appsCont-12-Win-GM">
            <Data key="appsnumbers">970767075516458272844213</Data>
        </Other>

</Configuration>

script
# load XML file into local variable and cast as XML type.
$doc = [xml](Get-Content ./test.xml)

$doc.root.one                                  

# find the value *970787075519458272844213* in the node and create a new one and update the xml files 


$doc.save("./testNew.xml")

ty for any help :)

A: IIRC $doc.save() won't accept a relative path.
According to mklement0's good hint the remedy I chose is OK, while the reason didn't hit the point
## Q:\Test\2019\03\03\SO_54972848.ps1
$FileIn = ".\test.xml"
$FileOut= Join-Path (Get-Item .) "testNew.xml"

$doc = [xml](Get-Content $FileIn)

$doc.Configuration.Other.Data.'#text'
$doc.Configuration.Other.Data.'#text' = -join (1..24|%{get-random -min 0 -max 9})
$doc.Configuration.Other.Data.'#text'

$doc.save($FileOut)

