Skip to content

Enhances 'spo file add' with additional options and response#7099

Merged
MartinM85 merged 1 commit intopnp:mainfrom
milanholemans:file-add
Jan 8, 2026
Merged

Enhances 'spo file add' with additional options and response#7099
MartinM85 merged 1 commit intopnp:mainfrom
milanholemans:file-add

Conversation

@milanholemans
Copy link
Copy Markdown
Contributor

Closes #4691

Remarks

Added two extra options, overwrite and fileName, for convenience. Overwrite is by default true to avoid breaking changes.

Copilot AI review requested due to automatic review settings January 7, 2026 12:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the spo file add command by adding two new options (overwrite and fileName) and making the command return response data instead of producing no output. The overwrite option defaults to true to maintain backward compatibility, while fileName allows users to specify a custom name for the uploaded file.

Key changes:

  • Added overwrite and fileName options to provide more control over file uploads
  • Modified command to return file metadata response object after upload
  • Updated documentation to include new options, permissions table, and response examples

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/m365/spo/commands/file/file-add.ts Added overwrite and fileName options, implemented file existence check logic, and updated command to return upload response
src/m365/spo/commands/file/file-add.spec.ts Added tests for new options and updated existing tests to verify response output
docs/docs/cmd/spo/file/file-add.mdx Documented new options, added permissions table, and provided comprehensive response examples across all output formats

Comment thread src/m365/spo/commands/file/file-add.ts Outdated
Comment thread src/m365/spo/commands/file/file-add.ts
Comment thread src/m365/spo/commands/file/file-add.spec.ts
Comment thread docs/docs/cmd/spo/file/file-add.mdx
Comment thread src/m365/spo/commands/file/file-add.spec.ts
@milanholemans milanholemans force-pushed the file-add branch 2 times, most recently from 552778f to 0b997c2 Compare January 7, 2026 12:44
Copy link
Copy Markdown
Contributor

@MartinM85 MartinM85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@MartinM85 MartinM85 merged commit aae71ee into pnp:main Jan 8, 2026
10 checks passed
@milanholemans milanholemans deleted the file-add branch January 8, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: file add commands should return file information

3 participants