New command: m365 spe containertype get
Usage
m365 spe containertype get [options]
Description
Get a specific Container Type
Options
| Option | Description |
|---|---|
-i, --id [id] |
The Id of the Container Type. Specify either id or name but not both. |
-n, --name [name] |
The Container Type name. Specify either id or name but not both. |
Examples
Gets Container Type by id
m365 spe containertype get --id '4ec4aefd-4fa3-0e4a-20c3-6e68389e7138'
Gets Container Type by name
m365 spe containertype get --name 'test container'
Additional Info
We may use CSOM for this command passing the following
<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="SharePoint Online PowerShell (16.0.24322.0)"
xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
<Actions>
<ObjectPath Id="49" ObjectPathId="48" />
<Method Name="GetSPOContainerTypeById" Id="50" ObjectPathId="48">
<Parameters>
<Parameter Type="Guid">{4ec4aefd-4fa3-0e4a-20c3-6e68389e7138}</Parameter>
<Parameter Type="Enum">1</Parameter>
</Parameters>
</Method>
</Actions>
<ObjectPaths>
<Constructor Id="48" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" />
</ObjectPaths>
</Request>
⚠️ Tricky part
The CSOM call does not support filtering by name only by Guid so if we want to add handling also querying the Container Type by name what we will need to do under the hood is query all Container Types and filter them by name.
Also if more than one Container Type will be found (as the name does not have to be unique) CLI (when interactive mode on) should prompt to pick the correct one based on id
@andrewconnell any feed on 👆
Sorry, no insights to share on this one.
The only remark from my side is that get commands don't implement default properties.
The only remark from my side is that
getcommands don't implement default properties.
Thanks for the comment. Removed. @pnp/cli-for-microsoft-365-maintainers any other comment before I open this up?
No comments. Good remark about getting containers by name. Let's do this.
Happy to work on it:)
Thank you!