I am trying to build a powershell script that can take an exported (to textfile) list of directories, and then pipe the file contents of each directory to another text file.

Doing some googling I found a few useful resources but cannot seem to get it to work as expected. (splitting text) (getting file list)

This is the most useable state I was able to get the script in to, which only lists the directories from a text file (and that was after I added an "*" before each directory.
$imagepaths = Get-Content -Path "C:\DK\Backup image paths.txt"
$separator = "*"
$pathoutput = Get-ChildItem -recurse
foreach ($pathoutput in $imagepaths)
# if the item is NOT a directory, then process it
if ($imagefile.Attributes -ne "Directory")
Write-Host $item.Name
$imagepaths is set for the SPI file directories
$pathoutput is intended to be the file listing of each directory in $imagepaths

I then need to get $pathoutput for each directory. I messed around with some different attempts, but the script never gave a result - any help is appreciated.

Thanks in advance =]