PowerShell - copy from desktop to temp directory


How do I copy a file (test.txt) from my desktop to a temp directory in PowerShell?

This is from exercise 55.12.3 in Appendix A. The instructions say: Open your text editor and type some stuff into a new file. Save that file to your desktop and name it test.txt. In your shell use the commands you know to copy this file to your temp directory that you’ve been working with.

  • desktop directory path is: C:\Users\anybritt\desktop

  • temp directory path is: C:\Users\anybritt\temp

Thanks in advance!

I Googled and found this:

PS C:> Copy-Item “C:\Wabash\Logfiles\mar1604.log.txt” -Destination “C:\Presentation”

Is this the only way to do this? If so, then it is not possible for us to complete this exercise with the commands that were covered in the book up until this exercise; and therefore that statement should be removed from the book as to not unnecessarily confuse/stress people out.

Hey @brittlallen, there’s actually a free part of my book that teaches you just enough PowerShell to be dangerous:


You should go through that.