Hi @Geraldo Peralta ,
maybe this helps:
$dirPath = "C:\Junk\Client"
$csvFile = "result.csv"
$delimiter = ","
"DirectoryName" + $delimiter + "FileName" | Out-File -FilePath $csvFile -Encoding utf8
Get-ChildItem -Path $dirPath -Directory |
ForEach-Object {
$_.Name + $delimiter + (Get-ChildItem -Path $_.Fullname | Select-Object -ExpandProperty Name) |
Out-File -FilePath $csvFile -Append -Encoding utf8
}
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten