Hallo,
i need a script that muss copy some file from one directory to another directory. All files in the directory have a *.txt extension. I only have to choose one of them. For example, I have the following files:
1.txt
2.txt
3.txt
4.txt
5.txt
6.txt
7.txt
etc.
I have defined the directory where the files are located as a variable and also the directory where I need to save the files.
In my script I only need to select some files to be copied (not all of them). For example:
2.txt, 4.txt, 6.txt
Below is some of the code I wrote:
Function CopyTxt {
$pathtxt = "C:\Users\admin\Desktop\update\"
$newtxt = "E:\User\txt\"
Copy-Item -Path $pathtxt -Destination $newtxt -Verbose
}
I need to select in "-Path $pathtxt " only some txt files. In $pathtxt are located all txt files.
Thank you advance for help.