Force parameter for remove-folder and Remove-file

Hi,

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

Thanks,

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.

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…

1 Like