Windows PowerShell (practice mode: nothing here touches your real computer)
Lesson 11: Build things (mkdir and ni)
Level 2, Talk to Your Computer: PowerShell. Make folders and files with commands and build a tree. The new word: New-Item. It follows lesson 10, Walk around (cd). Next comes lesson 12, Write and read (echo and cat).
What the lesson explains
Build things. Make folders and files with commands.
A space splits a command. The terminal reads my and games as two different words. On the card: mkdir my games
What you do first
A folder and a file. In the practice terminal, type mkdir games at the prompt PS C:\Users\you\Documents\my-project> and the computer answers: Directory: C:\Users\you\Documents\my-project / d---- games. It makes games.
The files on the practice computer
This lesson works in one folder. At the start, Documents\my-project holds images\, hello.py, notes.txt.
Along the way you type mkdir games, type ni ideas.txt, type mkdir my games, type mkdir my-games, type mkdir club, type ni members.txt, type mkdir photos and type ni games\rules.txt. Lesson 12 opens with the files just as you leave them.
What you practise
Try it, "A folder and a file": In the practice terminal, type mkdir games at the prompt PS C:\Users\you\Documents\my-project> and the computer answers: Directory: C:\Users\you\Documents\my-project / d---- games. It makes games. Then: In the practice terminal, type cd games at the prompt PS C:\Users\you\Documents\my-project>; the prompt then reads PS C:\Users\you\Documents\my-project\games>. Then: In the practice terminal, type ni ideas.txt at the prompt PS C:\Users\you\Documents\my-project\games> and the computer answers: Directory: C:\Users\you\Documents\my-project\games / -a--- ideas.txt. It makes ideas.txt.
Fix it, "Use a dash": In the practice terminal, type mkdir my-games at the prompt PS C:\Users\you\Documents\my-project> and the computer answers: Directory: C:\Users\you\Documents\my-project / d---- my-games. It makes my-games.
Challenge, "Build a tree": Build the club tree. Starting at PS C:\Users\you\Documents\my-project>, one way takes 6 commands: mkdir club; cd club; ni members.txt; mkdir photos; mkdir games; ni games\rules.txt (par: 6).
What PlayBuddy and PlayType say
PlayBuddy: "Time to build! Make folders and files without the mouse."
PlayType: "A space splits a command into pieces. Use a dash instead."
Help in every lesson
Everything happens on a pretend computer in your browser, so nothing touches your real files. PlayBuddy and PlayType stand beside the board, cheer you on and say when it is your turn.
A green ring shows where to click the first time. After that you do it on your own, and if you slip twice the ring comes back.
Stars
The lesson has 5 things to do. Up to one slip in ten gives three stars, up to one in four gives two, and finishing always gives at least one. Stars and progress are saved in this browser only; there is no account.
About DayOneCode
DayOneCode is an independent learning site, not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic.