Command Line Task Test

Command Line Task Test

A simple Command Line File System Task Test

If you're wondering if you have enough CLI (Command Line Interface) skills to work with the PowerShell Command Line, and files/folders within PowerShell, then you can use this Task Test to see if you can accomplish some basic tasks. If you have basic DOS/CMD Command Prompt knowledge you'll probably find you can use the same commands in PowerShell (there are standard aliases for most of them). If you need more thorough practice with the CLI then I suggest Zed's Appendix A CLI Crash Course.

You can keep the Basic File System Commands page open as a reference, all the commands you need are listed there. Or on one of the other pages (such as Symbols, Keystrokes, or PowerShell Essentials).

Follow through these tasks and try to accomplish them all via the PowerShell Command Line. At the end is a link to a page showing what you could type to complete each task - so if you're stuck you can also check there. These may all seem like trivial tasks, but that that's the point: you just need some basic CLI skills to make operating in PowerShell much easier. Good luck!

Note: You could use the CMD/DOS Command Prompt for most of these, but would need to make some modifications.
If you're just starting: I recommend you learn PowerShell.

Start Here

  1. Open PowerShell, what folder are you in? What version of PowerShell are you running?
  2. Change to the root of the drive, create a folder called Playground and change into it.
  3. Create a file called example.txt and put whatever you want in it (using Notepad or whatever editor you like)
  4. Create two sub-folders in Playground called: Folder1 and Folder2.
  5. List what's in the Playground folder.
  6. Copy example.txt into Folder1, and change to the Folder1 directory.
  7. Create a file called file.txt with the contents: write your PowerShell code here! (using Notepad or whatever editor)
  8. Copy file.txt to Folder2 and delete example.txt from Folder1.
  9. Change to Folder2.
  10. Rename file.txt to file.ps1. Try to run file.ps1 - what happens? If it doesn't work read the errors as they should tell you what to try. If it does something, why?
  11. Change back to the Playground folder.
  12. Create a file called Long Name.txt (with a space) and put whatever you want in it (using whatever editor you like)
  13. Look at what is inside of Long Name.txt and then rename it to tiny.txt.
  14. Move tiny.txt to Folder2. Change to Folder2.
  15. Make two copies of tiny.txt, one as temp.txt and one as test.txt.
  16. Show all the files in the current folder, show only the files that start with the letter T, and also show all the .PS1 files.
  17. Confirm you are in Folder2 and then delete all files in Folder2. Is Folder2 empty now?
  18. Change back one folder level and remove Folder2.
  19. Remove Folder1.
  20. See if any files are left, if so delete them. Change to the root of the drive and remove the Playground folder.
  21. Check if the Playground folder exists, quit from PowerShell.

Were you successful?

Were you able to complete all the tasks? If you got stuck or want to check if what you typed you can look at the CLI Task Test Answers to see a transcript of all the commands I typed to complete the Tasks (and the results). You may have used slightly different ones, that's OK - so long as you were able to accomplish each Task. If you need more practice try Zed's CLI Crash Course.