Force parameter for remove-folder and Remove-file


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


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

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.


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…

1 Like