Copy_Item cmdlet - More details can be found at Copy-Item
Copying Folder structure Only
123456789
$source = "C:\tools\DevKit2\octopress-blog\source"
$dest = "D:\delete"
Copy-Item $source $dest -Filter {PSIsContainer} -Recurse -Force
#OR
robocopy $source $dest /e /xf *.*
# /e denotes all folder including empty folders. /xf denotes all files except one of format *.*
# /e can be replaced with /s for ignoring empty folders
Flattening Folder structure - Copy all files from nested folders to a single folder
12345678
$source = "C:\tools\DevKit2\octopress-blog\source"
$dest = "D:\delete"
# Below is required only if we need to create destination folder. Uncomment below line if folder needs to be created
#New-Item $dest -type directory
Get-ChildItem $source -Recurse | `
Where-Object { $_.PSIsContainer -eq $False } | `
ForEach-Object {Copy-Item -Path $_.Fullname -Destination $dest -Force}