Hey there i need to move a lot of files using a powershell script and i kinda need help on this one.
The root is as following
> tree .
\
├───Folder1
│ ├───Sub1
│ │ └───Stockfile
│ └───Sub2
└───Folder2
├───Sub1
│ └───Stockfile
└───Sub2
The script needs to find the stockfiles and need to move them to the Sub2 folder of each mainfolder.
I made the following script to show all the stockfiles in a list:
$var = get-childitem -Filter *stock* -recurse
foreach ($file in $var) {
write-host ($file.FullName)
}
Sub2folder consistent? How do you 'know' the name of the destination folder? Is it explicitly namedSub2always?