Skip to content

Issue with script sample to upload files and folders to SharePoint #5672

@joelfmrodrigues

Description

@joelfmrodrigues

Priority

(Low) Something is a little off

Description

When trying the sample script https://pnp.github.io/cli-microsoft365/sample-scripts/spo/upload-local-files-and-folder to upload files and folders to SharePoint it failed with errors related to paths.
When recursively trying to upload nested folders, the local path of the parent folder is passed as part of the parameter to construct the new SP folder path.

Steps to reproduce

Create some nested folders and files.
Try to upload to SharePoint using the script sample here: https://pnp.github.io/cli-microsoft365/sample-scripts/spo/upload-local-files-and-folder

Expected results

All files and folders are uploaded to SharePoint as per the local structure

Actual results

Script creates the first folder and then fails as the path for the first child folder is invalid

Diagnostics

No response

CLI for Microsoft 365 version

v6.11.0

nodejs version

v18

Operating system (environment)

Linux

Shell

PowerShell

cli doctor

No response

Additional Info

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions