MSH: Remove-item ask behavior

Discussion in 'Scripting' started by Keith Hill, Nov 30, 2005.

  1. Keith Hill

    Keith Hill Guest

    I really like *ix's rm -rf * behavior. Yes it can burn you but that's what
    backups are for, right? :)

    With remove-item I really don't want to have to answer "A" to All. I just
    want it to delete everything I tell it to. I thought -Force would change
    this behavior but it doesn't. Ideally I would expect -Force to suppress
    this prompt/confirmation. Alternatively perhaps there needs to be
    a -noprompt parameter on remove-item.
    Keith Hill, Nov 30, 2005
    1. Advertisements

  2. Hmm - where are you seeing the prompts? If you try to remove a directory
    without specifying -recurse, it'll prompt but

    remove-item -recurse -force *

    should be pretty much identical to rm -rf *

    Bruce Payette [MSFT], Dec 1, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.