cli-microsoft365
cli-microsoft365 copied to clipboard
Enhancement: Specify listUrl when creating a new list
When creating a list using spo list add
, you can only influence it's URL by the title
option.
I'd like to specify my own URL though:
Option | Description |
---|---|
-u, --url |
Specify the web relative URL the list should have. |
Examples
Create a new list with the title Some list and the url lists/some-list.
m365 spo list add --webUrl "https://contoso.sharepoint.com/sites/project-x" --baseTemplate GenericList --title "Some list" --url
"Lists/some-list"
Looks good to me 👍
Only remark: for me you can drop the /Lists/
prefix, so just specify --url some-list
. If I'm not mistaken, it works the same way for CSOM APIs.
Also, could you also put the API request in your spec? This way it will be easier for whoever picks up this issue, else he/she has to research everything again.
for me you can drop the /Lists/ prefix, so just specify --url some-list
Well, I'd still like the freedom of picking either /Lists/some-list or just some-list. Both can be created, which is why I made it web relative.
Regarding the other point: that's okay, I'll look into it.
@martinlingstuyl is there anything more we need to recheck here before we open this up?
Yeah, I'd need to check the actual requests to update the specs.
I'm the meantime, are there any additional opinions on this @pnp/cli-for-microsoft-365-maintainers?
We should extend the spec to indicate if the --url
option is required. Also, we already use the -u
short on --webUrl
, so can't use it here. While it would make sense to be assigned to --url
, we can do that only in v7.
Hi people, I've just looked into it. The command currently uses the REST Api with SP.List
. This class does not have a URL
member. The ListCreationInformation
class does have the member, but this can't be used together with the newer REST Api as far as I know.
We'd have to rebuild the entire command using an older endpoint if we'd like to support it.
I'm doubting if that's worth the effort. What about you, @pnp/cli-for-microsoft-365-maintainers ?
First and foremost, if we're to rebuild the command using the new API, can we guarantee backwards compatibility or would there be breaking changes? If the latter, we'll delay it until v7 anyway, which could mean that between now add the capabilities will changes and deciding now would be less relevant.