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
urlorid, but not both.-i, --id [id]The UniqueId (GUID) of the file to archive. Specify either
urlorid, but not both.-f, --forceDon'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 isoptions.--query [query]JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]Output type.
json,text,csv,md,none. Defaultjson.--verboseRuns command with verbose logging.
--debugRuns command with debug logging.
Permissions
- Delegated
- Application
| Resource | Permissions |
|---|---|
| SharePoint | AllSites.Write |
| Resource | Permissions |
|---|---|
| SharePoint | Sites.ReadWrite.All |
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.