Skip to content

Add explicit warning to Remove-PnPWeb #5280

@emmafan313-prog

Description

@emmafan313-prog

Is your feature request related to a problem? Please describe.
Currently, the documentation for the Remove-PnPWeb cmdlet states that it “removes a subsite”, but it does not clearly warn users that the subsite is permanently deleted and is not moved to the SharePoint recycle bin.
This can be misleading for administrators who may assume the behavior is similar to other SharePoint deletion operations, where recovery via the recycle bin is possible. As a result, users may unintentionally cause irreversible data loss.

Describe the solution you'd like
Add a clear and prominent warning in the Remove-PnPWeb documentation indicating that:

The subsite is permanently deleted
The subsite is not sent to the recycle bin
The action cannot be undone
The cmdlet should be used with extreme caution, especially when combined with -Force or pipeline scenarios

For example, a warning section near the top of the page (or under DESCRIPTION) would significantly reduce the risk of accidental data loss.

Describe alternatives you've considered
Administrators may use alternative approaches such as:

Deleting subsites via the SharePoint UI
Exporting or backing up site content before deletion

However, these alternatives do not fully mitigate the risk when Remove-PnPWeb is used without understanding its permanent behavior.

Additional context
The current documentation page:
Remove-PnPWeb | PnP PowerShell [pnp.github.io]
This request is documentation-focused and does not require a change in cmdlet behavior—only clearer guidance and warnings for users.
A warning would be especially helpful for new administrators or scripted/bulk deletion scenarios.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions