Listing of folder and files name separated by semicolon into a file.

Hi Team,

I want to display  folder and files name separated by semicolon into a file, details as follows.

Folder structure:

Fodler1 --> file1.txt, file11.pdf

Fodler2 --> file2.txt, file21.pdf

Fodler3 --> file3.txt, file31.pdf

Output file format:

Fodler1;file1.txt;file11.pdf;

Fodler2;file2.txt;file21.pdf;

i managed to create a script however need help in fixing child files list separated by semicolon instead of space.

Get-ChildItem -path C:\Amar\ -Recurse |
Where-Object{ $_.PsIsContainer } |
Foreach{ $_.BaseName + ";" + $_.GetFiles() + ";" } | Out-File C:\Amar\filelist.txt

current output file format:(semicolon missing in the child files list)

Fodler1;file1.txt file11.pdf;

Fodler2;file2.txt file21.pdf;

Please do the needful.