Usage
m365 file move
Description
Moves 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
Moves a file using the graph
m365 file move --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
Two remarks;
- If we agree on this spec I shall create one for the
m365 file copy option as well (it will be the same structure)
- We most likely want to have a
m365 folder move and m365 file copy as well, the source could/would be the almost same. We could use an Alias for that and have our --sourceUrl reflect both files and folders.
- We should consider support for the
driveItem since that is something that will be returned by the m365 file list
@pnp/cli-for-microsoft-365-maintainers please chime in :D
Usage
m365 file move
Description
Moves a file to another location using the Microsoft Graph
Options
-u, --webUrl <webUrl>-s, --sourceUrl <sourceUrl>-t, --targetUrl <targetUrl>--newName [newName]--nameConflictBehavior [nameConflictBehavior]fail,replace,rename. Default isfail.Examples
Moves a file using the graph
Default properties
No response
Additional Info
m365 file addcommand using the Microsoft Graph this should be part of that command structureTwo remarks;
m365 file copyoption as well (it will be the same structure)m365 folder moveandm365 file copyas well, the source could/would be the almost same. We could use an Alias for that and have our--sourceUrlreflect both files and folders.driveItemsince that is something that will be returned by them365 file list@pnp/cli-for-microsoft-365-maintainers please chime in :D