Usage
m365 spo file version list [options]
Description
Retrieves all version of a file from version history
Options
| Option |
Description |
-w, --webUrl <webUrl> |
The URL of the site where the file is located |
-u, --fileUrl [fileUrl] |
The server-relative URL of the file to retrieve. Specify either fileUrl or fileId but not both |
-i, --fileId [fileId] |
The UniqueId (GUID) of the file to retrieve. Specify either fileUrl or fileId but not both |
Examples
Lists file version history by id
m365 spo file version list --webUrl https://contoso.sharepoint.com/sites/project-x --fileId 'b2307a39-e878-458b-bc90-03bc578531d6'
Lists file version history by url
m365 spo file version list --webUrl https://contoso.sharepoint.com/sites/project-x --fileUrl '/sites/project-x/documents/Test1.docx'
Additional Info
we may reuse spo file get command with asListItem option to get the item id and then we may use this endpoint to achieve it
/_api/web/Lists/getbytitle('JobTitles')/items(1)/versions
Usage
m365 spo file version list [options]
Description
Retrieves all version of a file from version history
Options
-w, --webUrl <webUrl>-u, --fileUrl [fileUrl]-i, --fileId [fileId]Examples
Lists file version history by id
m365 spo file version list --webUrl https://contoso.sharepoint.com/sites/project-x --fileId 'b2307a39-e878-458b-bc90-03bc578531d6'Lists file version history by url
m365 spo file version list --webUrl https://contoso.sharepoint.com/sites/project-x --fileUrl '/sites/project-x/documents/Test1.docx'Additional Info
we may reuse
spo file getcommand withasListItemoption to get the item id and then we may use this endpoint to achieve it