Skip to content

New command: m365 spe container remove #6084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Adam-it opened this issue Jun 9, 2024 · 7 comments
Closed

New command: m365 spe container remove #6084

Adam-it opened this issue Jun 9, 2024 · 7 comments
Assignees
Milestone

Comments

@Adam-it
Copy link
Member

Adam-it commented Jun 9, 2024

Usage

m365 spe container remove [options]

Description

Removes a container

Options

Option Description
-i, --id [id] Container id. Specify either id or name but not both.
-n, --name [name] Display name of the Container. Specify either id or name but not both.
--recycle Recycle a container instead of actually deleting it.
-f, --force Don't prompt for confirming removing the list item

Examples

Permanently deletes a container

m365 spe container remove --id "b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z"

Recycles a container

m365 spe container remove --id "b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z" --recycle 

Default properties

No response

Additional Info

we may use the following DELETE request to move a container to recycle bin

/storage/fileStorage/containers/{containerId}

https://learn.microsoft.com/en-us/graph/api/filestorage-delete-containers?view=graph-rest-1.0&tabs=http

to permanently delete it we may use

beta/storageContainers/{containerId}/permanentDelete

Also when using name option we will need to run the /fileStorage/containers to list all containers and match the container by name.

what's worth noticing is that permanent delete as of now is only available on beta MS Graph endpoint

https://learn.microsoft.com/en-us/graph/api/filestoragecontainer-permanentdelete?view=graph-rest-betathe

@Adam-it Adam-it added new feature needs peer review Needs second pair of eyes to review the spec or PR labels Jun 9, 2024
@Adam-it
Copy link
Member Author

Adam-it commented Jun 22, 2024

@pnp/cli-for-microsoft-365-maintainers any feed?

@Jwaegebaert
Copy link
Contributor

The recycle option is a bit vague. Won't it make more sense to recycle by default and hard delete it when you specify an additional option?

One small additional detail is that we're missing the --force option here.

@Adam-it
Copy link
Member Author

Adam-it commented Jul 15, 2024

Thank you for your comments.

The recycle option is a bit vague. Won't it make more sense to recycle by default and hard delete it when you specify an additional option?

Well this is aligned with what we have. Remove hard by default and recycle when --recycle is specified. as an example
https://pnp.github.io/cli-microsoft365/cmd/spo/file/file-remove
or
https://pnp.github.io/cli-microsoft365/cmd/spo/listitem/listitem-remove

One small additional detail is that we're missing the --force option here.

thanks. Added 👍

@Adam-it
Copy link
Member Author

Adam-it commented Jul 15, 2024

@pnp/cli-for-microsoft-365-maintainers any other comment?

@Adam-it Adam-it added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels Jul 19, 2024
@waldekmastykarz
Copy link
Member

Looks good, ship it!

@Adam-it Adam-it added the hacktoberfest Issue perfect for hacktoberfest label Sep 24, 2024
@Adam-it Adam-it removed the hacktoberfest Issue perfect for hacktoberfest label Nov 3, 2024
@milanholemans
Copy link
Contributor

Let's also use container name as option.

@milanholemans milanholemans self-assigned this Apr 18, 2025
milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue Apr 18, 2025
milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue Apr 18, 2025
milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue Apr 18, 2025
@Adam-it
Copy link
Member Author

Adam-it commented May 8, 2025

Let's also use container name as option.

please check my comment from here #6085 (comment)
if we are fine with the bit of overhead then sure I will update this and other container related commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants