Force parameter for remove-folder and Remove-file

//Force parameter for remove-folder and Remove-file
Force parameter for remove-folder and Remove-file 2017-01-24T14:37:48+00:00

The Toolkit Forums General Force parameter for remove-folder and Remove-file

  • Author
    Posts
  • Francois
    Participant
    Post count: 101
    #1861 |

    Hi,

    I just discovered there is no parameter -Force for the Remove-Folder and remove-file. Any reason why?

    Thanks,

  • Jim
    Participant
    Post count: 45

    Both of those functions force the file/folder to be removed… You can see for yourself in the AppDeployToolkit\AppDeployToolkitMain.ps1 file…

  • Matt
    Participant
    Post count: 11

    In all seriousness, I don’t know why they took something that works great natively and remade it to work…less…great, so I just use the native commands:
    Remove-Item -force (files) or remove-item -force -recurse (directories)

    Seems like wasted effort that could have been spent in other areas.

  • Jim
    Participant
    Post count: 45

    Matt,

    I don’t think they work “work…less…great”… The functions have -force built-in probably because they assume you are an admin and know that you really want to delete the file/folder… Plus they have great logging built-in…

You must be logged in to reply to this topic.