Open Adam-it opened 2 months ago
@andrewconnell any opinion on that 👆
2 remarks:
1) Only trial Container Types can be removed, does this mean that we don't have to check for the type ourselves and the API will just throw a decent error when you try to remove a standard container type?
2) Documentation quote:
To delete a trial Container Type, you must remove all Containers of the Trial Container Type first, including from the recycle bin. To remove Containers from the Trial Container Type, refer to Consuming Tenant Admin. Once all the Containers are deleted, Developer Admins can delete the Container Types using the below PowerShell cmdlet.
What will happen if we run this command when there are still containers attached? Will we remove them, or just throw an error?
2 remarks:
- Only trial Container Types can be removed, does this mean that we don't have to check for the type ourselves and the API will just throw a decent error when you try to remove a standard container type?
yes it will return something like Tenant 2942bb31-1d49-4da6-8d3d-d0f9e1141486 cannot delete Container Type 32793d51-870d-07da-113f-b586dee1c12a as it is Standard ContainerType.
Documentation quote:
To delete a trial Container Type, you must remove all Containers of the Trial Container Type first, including from the recycle bin. To remove Containers from the Trial Container Type, refer to Consuming Tenant Admin. Once all the Containers are deleted, Developer Admins can delete the Container Types using the below PowerShell cmdlet.
What will happen if we run this command when there are still containers attached? Will we remove them, or just throw an error?
I think we should throw an error.
Ok, thanks for clarifying. Let's open it up then.
Usage
m365 spe containertype remove [options]
Description
Remove a specific Container Type
Options
-i, --id [id]
id
orname
but not both.-n, --name [name]
id
orname
but not both.-f, --force
Examples
Removes Container Type by id
Removes Container Type by name
Removes Container Type by id and doesn't prompt for confirmation
Default properties
No response
Additional Info
We may use CSOM for this command passing the following
⚠️ Tricky part
The CSOM call does not support filtering by
name
only byGuid
so if we want to add handling also remove the Container Type byname
what we will need to do under the hood is query all Container Types and filter them byname
. Also if more than one Container Type will be found (as thename
does not have to be unique) CLI (when interactive mode on) should prompt to pick the correct one based onid
❗Important
We need to handle that only
Trail
Container Type may be removed. This should be added to the command spec