Skip to content

Enhancement: recursively add parent folders using spo folder add #5887

@JiahaoJiZhou

Description

@JiahaoJiZhou

Usage

m365 spo folder add -r -u "site-url" -p "parent-folders" -n "folder-name"

Description

The command currently exists, I suggest adding a -r option, so if the parentFolder doesnt exist, it would just create them

Options

-r, --recursive | If the parent folder does not exist, it creates it recursively

Examples

m365 spo folder add -r -u "site-url" -p "parent-folders-not-exist1/parent-folder-not-exist2/parent-folder-not-exist3" -n "folder-name"

The outcome would be to have parent-folders-not-exist1/parent-folder-not-exist2/parent-folder-not-exist3/folder-name created in the site-url

Default properties

No response

Additional Info

Hi, the command currently exists, but it would be nice to have this extra option


Updated spec

Options

Option Description
--ensureParentFolders Ensure that the parent folder path is available. Any missing folders will be created recursively.

Examples

Create a folder and make sure that any missing folders specified as parent folders are created.

m365 spo folder add --webUrl https://contoso.sharepoint.com/sites/project-x --parentFolderUrl '/Projects/2024/Q1/Reports' --name Financial --ensureParentFolders

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions