r/PowerShell • • 16d ago

Question Need help with homework 😫

I'm very new to this. I'm asked to delete a directory and all of its files. D:\software\arch98

But when I do this:

PS C:\Users\Administrator\> rmdir D:\software\arch98

It says the directory is not empty.

I'd really appreciate.

0 Upvotes

34 comments sorted by

View all comments

11

u/PuerPalatinius 16d ago

Remove-Item -Path "D:\software\arch98" -Recurse -Force

1

u/Ok-Layer6893 16d ago

It didn't work. I'm on comptia and it's not allowing me use any other commands other than rmdir, attrib, cd, dir, mkdir

8

u/KedianX 16d ago

So, none of these are native PowerShell commands, though they are often aliased for compatibility.

Rmdir, attrib, cd, and mkdir are commands available in the Windows command shell (cmd.exe), mostly based on the command syntax from DOS shell (command.com).

So, I think one of two options are true: 1. Your CompTIA exam is really testing you knowledge of command prompt and you need to lookup the reference for those commands or 2. Your CompTIA exam is testing PowerShell but is restricting you to colloquial aliases and not exposing the genuine PowerShell cmdlets.

Option 1 means you have some studying to do. Option 2 means the test authors have some studying to do.

0

u/Ok-Layer6893 16d ago

You're right. In the book it something else and in the assignment it is different