Skip to main content

spo folder get

Gets information about the specified folder

Usage

m365 spo folder get [options]

Options

-u, --webUrl <webUrl>

The URL of the site where the folder is located.

-f, --url [url]

The server- or site-relative URL of the folder to retrieve. Specify either folderUrl or id but not both.

-i, --id [id]

The UniqueId (GUID) of the folder to retrieve. Specify either url or id but not both.

--withPermissions

Set if you want to return associated roles and permissions of the folder.

-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 full.

--query [query]

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

-o, --output [output]

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

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks

If no folder exists at the specified URL, you will get a Please check the folder URL. Folder might not exist on the specified URL error.

If root level folder is passed, you will get a Please ensure the specified folder URL or folder Id does not refer to a root folder. Use \'spo list get\' with withPermissions instead' error. Please use the command 'spo list get'.

Examples

Get folder properties for a folder with a specific site-relative URL

m365 spo folder get --webUrl https://contoso.sharepoint.com/sites/project-x --url "/Shared Documents"

Get folder properties for a folder with a specific id (UniqueId)

m365 spo folder get --webUrl https://contoso.sharepoint.com/sites/project-x --id "b2307a39-e878-458b-bc90-03bc578531d6"

Get folder properties with permissions for a folder with server-relative URL

m365 spo folder get --webUrl https://contoso.sharepoint.com/sites/test --url "/sites/test/Shared Documents/Test1" --withPermissions
CTRL + M