Skip to content

Remove commands recycle items by default #7110

@milanholemans

Description

@milanholemans

Currently, we have quite a few remove commands that destructively remove stuff from the M365 environment. Take, for example, the command spo file remove. By just providing the required parameters, this command will remove the file permanently, without the ability to restore it. This is bad; we want the user to explicitly consent to the permanent removal of an item. This prevents stuff from being removed permanently by accident.

The idea is to check all destructive commands (most of them end with remove). Let's check if this command has the ability to both recycle and permanently delete an item. If this is the case, make sure that we recycle the item by default and add a flag --permanent to permanently delete it.
Example: for the command spo file remove, we should remove the option --recycle and add the option --permanent.

TODO

  • Check if every destructive command recycles an item by default
    • Replace --recycle by --permanent
  • Some destructive commands use the option --skipRecycleBin, let's rename these to --permanent for convenience

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions