New command: `spe containertype set`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 413
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 21
Description
Usage
m365 spe containertype set [options]
Description
Updates a SharePoint Embedded 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. |
--newName [newName] |
New name for the container type. |
--urlTemplate [urlTemplate] |
URL template for container redirection. |
--isDiscoverabilityEnabled [isDiscoverabilityEnabled] |
Indicates whether items from containers are surfaced in experiences such as My Activity or Microsoft 365. Possible values: true, false. |
--isSearchEnabled [isSearchEnabled] |
Indicates whether search is enabled. Possible values: true, false. |
--isItemVersioningEnabled [isItemVersioningEnabled] |
Indicates whether item versioning is enabled. Possible values: true, false. |
--itemMajorVersionLimit [itemMajorVersionLimit] |
Maximum number of versions. Versioning must be enabled. |
--isSharingRestricted [isSharingRestricted] |
Indicates whether sharing is restricted. Only the manager and owner can share files in the container if restricted sharing is enabled. Possible values: true, false. |
--sharingCapability [sharingCapability] |
Sharing capabilities permitted for containers. This value can always be overridden during registration if needed. The possible values are: disabled, externalUserSharingOnly, externalUserAndGuestSharing, existingExternalUserSharingOnly, unknownFutureValue. |
--consumingTenantOverridables [consumingTenantOverridables] |
A comma-separated list of settings that can be overridden in the consuming tenant. The possible values are: urlTemplate, isDiscoverabilityEnabled, isSearchEnabled, isItemVersioningEnabled, itemMajorVersionLimit, maxStoragePerContainerInBytes, unknownFutureValue. |
Examples
Update the container type name by Id
m365 spe containertype set --id de988700-d700-020e-0a00-0831f3042f00 --newName "Standard containers"
Update the container type name by name
m365 spe containertype set --name "Old CT Name" --newName "New CT Name"
Update selected settings
m365 spe containertype set --id de988700-d700-020e-0a00-0831f3042f00 --isItemVersioningEnabled true --isSharingRestricted false
Update multiple settings including URL template and search
m365 spe containertype set --id de988700-d700-020e-0a00-0831f3042f00 --urlTemplate "https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}" --isSearchEnabled true
Update name and multiple settings by container type name
m365 spe containertype set --name "Contoso CT" --newName "Contoso CT Updated" --isDiscoverabilityEnabled false --maxStoragePerContainerInBytes 1073741824 --sharingCapability externalUserAndGuestSharing
Default properties
No response
Additional Info
A few remarks:
- This command uses Microsoft Graph beta and is subject to change.
- Requires new delegated permission
FileStorageContainerType.Manage.All. Application permissions are not supported. - The API uses optimistic concurrency with
etag. If the supplied ETag doesn’t match the current value, the update fails. So we need the fetch the Container Type beforehand and pass this tag along the PATCH request. - Changes to settings propagate to registrations within ~24 hours. Some settings might not retroactively apply to existing containers (for example, storage size); those may need updating directly on the container.
ref: https://learn.microsoft.com/graph/api/filestoragecontainertype-update?view=graph-rest-beta
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the command entry point for spe containertype set and review related SharePoint Embedded container type commands for their option handling and Graph requests. Implement the documented identifier and update options, fetching the container type's ETag before the PATCH request. Done means the examples and optimistic-concurrency behavior work with the required delegated permission.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100