Skip to content

Enhancement: file add commands should return file information #4691

@evilhamsterman

Description

@evilhamsterman

Description

I'm trying to script out uploading files then either retrieving or creating a link to the file but neither the m365 file add or the m365 spo file add return any data about the file they simply exit. This means that I then have to do a second request to get the file information using m365 spo file get since there is no m365 file get

To further complicate matters the command to add a file uses the folder relative to the weburl, but the command to get a file uses the folder relative to the server. For example
m365 spo file add --webUrl https://contoso.sharepoint.com/sites/project-x --folder "Shared Documents" --path file.xlsx
m365 spo file get --webUrl https://contoso.sharepoint.com/sites/project-x --url "/sites/project-x/Shared Documents/file.xlsx"

Steps to reproduce

Upload a file to Sharepoint

Expected results

Upload a file to Sharepoint and get back values about the file such as the UID, etc.

Actual results

Nothing is returned

Diagnostics

No response

CLI for Microsoft 365 version

"v6.3.0"

nodejs version

v18.15.0

Operating system (environment)

Linux

Shell

bash

cli doctor

No response

Additional Info

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions