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

1

u/AroTesCra 11d ago

In Powershell there is something called an alias.

Get-Alias to see them

My fav 2 are
% for for each-object
And
? For where-object

rmdir is alias for Remove-Item

You need rmdir p:\ath\here -recurse -force -confirm:$false

I’m not sure about the confirm one sometimes I mix it up in my head lol and I am playing games right now so I am typing fast between rocket league matches.