Skip to content

New command: m365 file copy #4623

@appieschot

Description

@appieschot

Usage

m365 file copy

Description

Copies a file to another location using the Microsoft Graph

Options

Option Description
-u, --webUrl <webUrl> The URL of the site where the file is located.
-s, --sourceUrl <sourceUrl> Server-relative or absolute URL of the file.
-t, --targetUrl <targetUrl> Server-relative or absolute URL of the location.
--newName [newName] New name of the destination file.
--nameConflictBehavior [nameConflictBehavior] Behavior when a document with the same name is already present at the destination. Possible values: fail, replace, rename. Default is fail.

Examples

Copies a file using the graph

m365 file copy--webUrl https://contoso.sharepoint.com/sites/project --sourceUrl "/sites/project/Shared Documents/Document.pdf" --targetUrl "/sites/IT/Shared Documents"

Default properties

No response

Additional Info

  • We currently have a m365 file add command using the Microsoft Graph this should be part of that command structure
  • Should use the new Drive API
  • Validate if we already have appropriate permissions for this command
  • Related to New command: m365 file move #4607

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions