Skip to main content

spo file version get

Gets information about a specific version of a specified file

Usage

m365 spo file version get [options]

Options

-u, --webUrl <webUrl>

The URL of the site where the file is located.

--label <label>

Label of version which will be retrieved.

--fileUrl [fileUrl]

The server- or site-relative decoded 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.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Examples

Get file version in a specific site based on fileId.

m365 spo file version get --webUrl https://contoso.sharepoint.com --label "1.0" --fileId 'b2307a39-e878-458b-bc90-03bc578531d6'

Get file in a specific site based on fileUrl.

m365 spo file version get --webUrl https://contoso.sharepoint.com --label "1.0" --fileUrl '/Shared Documents/Document.docx'

Response

{
"CheckInComment": "",
"Created": "2022-10-30T12:03:06Z",
"ID": 512,
"IsCurrentVersion": false,
"Length": "18898",
"Size": 18898,
"Url": "_vti_history/512/Shared Documents/Document.docx",
"VersionLabel": "1.0"
}
CTRL + M