I am currently learning how to use PowerShell. I was wondering if it would be possible for someone to tell me how to copy multiple text files from multiple sub-directories using the command line portion of PowerShell. I know how to do this in regular CMD and it looks something like this:
for /f "delims=" %F in ('dir \*.txt /s/b') do copy "%~F" "C:\test\" /Y
But obviously this does not work in PowerShell and needs a good bit of tweaking. Any help would be much appreciated. Thanks!
I was actually able to figure it out. This is how i did it:
get-childitem -path "SOURCE\PATH" -filter *.txt -recurse | copy-item -destination "DESTINATION\PATH"
Thanks anyway!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With