how to get powershell to look for files in other folders when moving items?
Posted
by
steeluser
on Stack Overflow
See other posts from Stack Overflow
or by steeluser
Published on 2011-01-10T16:16:25Z
Indexed on
2011/01/10
21:54 UTC
Read the original article
Hit count: 194
powershell
|powershell-v2.0
I have written this script to move files to the destination folder. Looks like I am missing something here because when I run the script, it is only looking for .zqx files in current directory and not all the drives. Please note that the ( dir $paths..) part is returning the list of .zqx files promptly.
Paths.txt has drive letters like this C:\ D:\ E:\
$paths = get-content paths.txt
mv (dir $paths -r -fi *.zqx | ?{$_.lastwritetime -lt ($sevendaysold)}) -dest e:\xqz
Thanks
Steeluser
© Stack Overflow or respective owner