Skip to content
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

New command: m365 spe containertype get #5991

Open
Adam-it opened this issue Apr 23, 2024 · 7 comments
Open

New command: m365 spe containertype get #5991

Adam-it opened this issue Apr 23, 2024 · 7 comments

Comments

@Adam-it
Copy link
Contributor

Adam-it commented Apr 23, 2024

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

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

Adam-it commented Apr 23, 2024

@andrewconnell any feed on 👆

@andrewconnell
Copy link
Contributor

Sorry, no insights to share on this one.

@milanholemans
Copy link
Contributor

The only remark from my side is that get commands don't implement default properties.

@Adam-it
Copy link
Contributor Author

Adam-it commented Apr 25, 2024

The only remark from my side is that get commands don't implement default properties.

Thanks for the comment. Removed.
@pnp/cli-for-microsoft-365-maintainers any other comment before I open this up?

@waldekmastykarz
Copy link
Member

No comments. Good remark about getting containers by name. Let's do this.

@Adam-it Adam-it added help wanted good first issue and removed needs peer review Needs second pair of eyes to review the spec or PR labels Apr 26, 2024
@reshmee011
Copy link
Contributor

Happy to work on it:)

@milanholemans
Copy link
Contributor

Thank you!

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

No branches or pull requests

5 participants