$sourceFolder = "C:\パス\フォルダA"
$destinationFolder = "C:\パス\フォルダB"
# フォルダAの全サブフォルダ内のファイルを再帰的に取得し、フォルダBにコピー
Get-ChildItem -Path $sourceFolder -Recurse -File | ForEach-Object {
$destinationPath = Join-Path -Path $destinationFolder -ChildPath $_.Name
Copy-Item -Path $_.FullName -Destination $destinationPath -Force
}
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme