I am having a hard time using Copy-item for copying files(only) recursively with a particular extension(*.txt) without the directory structure. Can anyone please give me a hand? I have used the the gci with -recurse and piped the output to copy-item, it gives an error saying improper input. Get-ChildItem -Path $source -include "*name*.txt" -recurse | Copy-Item $source $dest
copy files only not directory structure using powershell
1.2k views Asked by Moe Hussa At
1
Use -file for take only file and not directory. Copy-item into pipe must have only destination path... -force if doublon file
try this:
if you have doublon you can try this :