Thank you guys very much! using the ./ worked great.
I would like to mention for anyone else who has this problem in the future. Testing this function in the developer window of powershell will not work! I'm not sure how the powershell ISE runs scripts, but the ./ directory is different, my assumption is it creates a temp file to run the script.
Example: if you saved the script ps1 file to a folder on the desktop and did a copy-item ./test.txt it will give you an error because it wont be able to find it, since powershell ISE runs scripts somewhere else.
Now if you ran the actual ps1 file in the folder on the desktop it will work.
(Again I'm new to this, as in my first week of scripting. So please bare with me if my terms are off)
The topic ‘How to copy files from a source with a changing name’ is closed to new replies.