## cambio DIR
#cd "C:\Users\samuele.steamw\source\Mapo-IOB-WIN\IOB-WIN-NEXT\DATA\RECIPE\FIMAT"

# leggo ogni file
$fileList = Get-Childitem *.xml #99999.xml 

foreach($file in $fileList)
{
    # nome ricetta (senza xml...
    $fileName=$file | Select-Object Name
    $recName = $fileName.Name.Replace('.xml','')
    #$recName
    $contenuto = Get-Content $file -Raw
    $find = "<RecName>(.|\n)*?</RecName>"
    $replace = '<RecName>'+$recName+'</RecName>'
    $newContenuto = $contenuto -replace $find,$replace
    $newContenuto = $newContenuto.Trim()
    #$newContenuto
    Set-Content -Path $file -Value $newContenuto
}
