Skip to content

spo file list

Gets all files within the specified folder and site

Usage

m365 spo file list [options]

Options

-u, --webUrl <webUrl>
The URL of the site where the folder from which to retrieve files is located
-f, --folder <folder>
The server- or site-relative URL of the folder from which to retrieve files
-r, --recursive
Set to retrieve files from subfolders
-h, --help
output usage information
--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples
-o, --output [output]
Output type. json,text. Default text
--verbose
Runs command with verbose logging
--debug
Runs command with debug logging

Examples

Return all files from folder Shared Documents located in site https://contoso.sharepoint.com/sites/project-x

m365 spo file list --webUrl https://contoso.sharepoint.com/sites/project-x --folder 'Shared Documents'

Return all files from the folder Shared Documents and all the sub-folders of Shared Documents located in site https://contoso.sharepoint.com/sites/project-x

m365 spo file list --webUrl https://contoso.sharepoint.com/sites/project-x --folder 'Shared Documents' --recursive