I have a folder with thousands of images of various file types. The eaisest way for me to move the relevant files is by filename as I can’t confirm all the file types in the folder without going through the list.
$source = ''
$dest = ''
Get-ChildItem $source -filter *. -recurse | Select-String -List -Pattern "Image1","Image2","Image3" | ForEach-Object {
Move-Item $PSItem.Path -Destination $dest
}
I am new to powershell and first tested it with a script I found on Stack to move text files from one folder to another based on name which worked fine but when I adjusted this to allow for multiple file names and for images of various file types I can’t get it to work. I first tried with one image file and one image type and even that wasn’t working. Help appreciated.
0