Powershell Loop through Format-Table
<p>I've got a question.
I've created a format-table with filename, source- and destination directory.
Now I try to loop through the table with a foreach.
Inside this loop i want to move the files from the source- to destination directory. My problem is to get the items from the row.</p>

<p>Here is my example code:</p>

<pre><code>cls
$MovePathSource = "C:\Users\user\Desktop\sourcefolder"
$MovePathDestination = "C:\Users\user\Desktop\destinationfolder"

$filetypes = @("*.llla" , "html")
$table = dir $MovePathSource -Recurse -Include $filetypes | Format-Table@{Expression={$_.Name};Label="Filename"},@{Expression={($_.DirectoryName)};Label="Sourcepath"},@{Expression={($_.DirectoryName).Replace($MovePathSource,$MovePathDestination)};Label="Destinationpath"}

$table

foreach ($row in $table)
{
write-host "$row.Sourcepath"
#Move-Item -Path ($row.Sourcepath + "\" + $row.Filename) -Destination $row.Destinationpath
}
</code></pre>