Skip to main content

spo file archive

Archives a file

Usage

m365 spo file archive [options]

Options

-u, --webUrl <webUrl>

The URL of the site where the file is located.

--url [url]

The server- or site-relative decoded URL of the file to archive. Specify either url or id, but not both.

-i, --id [id]

The UniqueId (GUID) of the file to archive. Specify either url or id, but not both.

-f, --force

Don't prompt for confirmation.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, permissions, 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.

Permissions

ResourcePermissions
SharePointAllSites.Write

Examples

Archive a file by id without prompting for confirmation

m365 spo file archive --webUrl https://contoso.sharepoint.com/sites/Marketing --id 7a8c9207-7745-4cda-b0e2-be2618ee3030 --force

Archive a file by URL with prompting for confirmation

m365 spo file archive --webUrl https://contoso.sharepoint.com/sites/Marketing --url '/sites/Marketing/shared documents/document.docx'

Response

The command won't return a response on success.