New command: m365 spe container recyclebinitem restore
Usage
m365 spe container recyclebinitem restore [options]
Description
Restores a deleted 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. |
Examples
Restores deleted container
m365 spe container recyclebinitem restore --id "b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z"
Default properties
No response
Additional Info
we may use the following POST request:
/deletedStorageContainers/{containerId}/restore
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 it is still beta
https://learn.microsoft.com/en-us/graph/api/filestoragecontainer-restore?view=graph-rest-beta
@pnp/cli-for-microsoft-365-maintainers any feed or could we open this up?
Not much to add, one small detail could be to clarify the description a bit more. But besides that, ship it!
Shouldn't we also add the option containerName to keep it consistent with other commands?
Also, the name should be spe container recyclebinitem restore.
Shouldn't we also add the option
containerNameto keep it consistent with other commands?
@milanholemans till now from what I checked I did not specify name options for the remove/get/active commands. But I will check if we may add that option. Most probably the API used here does not allow to specify by name only by id, the same goes for the GET endpoint. So most probably this would mean that when the name is used every time we would need to list all containers for that container type and find if any of the one listed match by name with what the user specified. If we are ok with that then sure I will add the name option for all the container commands previously mentioned.
Also I suggest we go with name not containerName right?
Also, the name should be
spe container recyclebinitem restore.
sure will update
@milanholemans till now from what I checked I did not specify name options for the
remove/get/activecommands. But I will check if we may add that option. Most probably the API used here does not allow to specify bynameonly byid, the same goes for the GET endpoint. So most probably this would mean that when the name is used every time we would need to list all containers for that container type and find if any of the one listed match by name with what the user specified. If we are ok with that then sure I will add thenameoption for all the container commands previously mentioned. Also I suggest we go withnamenotcontainerNameright?
That's true, it's up to the user to decide which approach he likes. We have quite some commands doing the same thing, like getting a group by name, Planner plan by name, ... We can create a util for it and reuse it everywhere.
@milanholemans ok, I will add this option and to the releadted commands as well then