pnp / cli-microsoft365

Manage Microsoft 365 and SharePoint Framework projects on any platform
https://aka.ms/cli-m365
MIT License
882 stars 312 forks source link

New command: `m365 spo folder sharinglink set` #5964

Open MathijsVerbeeck opened 3 months ago

MathijsVerbeeck commented 3 months ago

Usage

m365 spo folder sharinglink set [options]

Description

Updates a specific sharing link to a folder

Options

Option Description
-u, --webUrl <webUrl> The URL of the site where the file is located
--folderUrl [folderUrl] The server- or site-relative decoded URL of the folder. Specify either folderUrl or folderId but not both
--folderId [folderId] The unique ID (GUID) of the folder. Specify either folderUrl or folderId but not both
-i, --id <id> The sharing link ID
--role [role] Role to set. Possible options are: read or write.
--expirationDateTime [expirationDateTime] The date and time to set the expiration. This should be defined as a valid ISO 8601 string.

Examples

Updates the expiration datetime of an anonymous sharing link with a specific id.

m365 spo folder sharinglink set --webUrl https://contoso.sharepoint.com/sites/demo --folderId daebb04b-a773-4baa-b1d1-3625418e3234 --id 1 --expirationDateTime '2022-11-30T00:00:00Z'

Updates the roles of a sharing link.

m365 spo folder sharinglink set --webUrl https://contoso.sharepoint.com/sites/demo --folderUrl /sites/demo/shared%20documents/Folder --id 1 --role read

Default properties

No response

Additional Info

The API call to set a sharing link can be found on the following documentation: https://learn.microsoft.com/en-us/graph/api/permission-update?view=graph-rest-v1.0&tabs=http

Currently, using the Graph 1.0 API, it is not possible to modify sharing links of type 'Organizational'.

Adam-it commented 2 months ago

Currently, using the Graph 1.0 API, it is not possible to modify sharing links of type 'Organizational'.

we should definitely add this to a remark section in the command docs.

Other than that LGTM πŸ‘. Awesome work πŸ‘ @pnp/cli-for-microsoft-365-maintainers last change to have a πŸ‘€ on this before we open it up πŸ‘

Jwaegebaert commented 2 months ago

Looks good! @MathijsVerbeeck, do you want to work on this one?

Saurabh7019 commented 2 months ago

Can I work on it?

milanholemans commented 2 months ago

Sure, thanks @Saurabh7019