I need to move set of specific files having different extension to another folder.
I have following filtered files in the directory.
file1.txt file2.xml file3.dll
I have kept the above files in the variable $files
and I need to move each of files to another folder.
Below is the code I tried.
foreach ($fileType in $files) {
Get-ChildItem -Path C:\Files -Filter "$fileType*." -Recurse |
Move-Item -Destination C:\Dest
}
I am getting following error
Get-ChildItem : Illegal characters in path. At line:1 char:38 + ... lude_files){Get-ChildItem -Path C:\Files
Appreciate if anyone can help on this?