Closed appieschot closed 7 months ago
similar comment like in the move
command. Do you think this could replace the m365 spo file copy
command with an alias 🤔?
@pnp/cli-for-microsoft-365-maintainers could we double check this one 😊
@appieschot i think the related/similar issue was rechecked and is opened now. Maybe we could open this one as well?
Let's open it up 👍
- Validate if we already have appropriate permissions for this command
Is the requirement to check if the user executing the command has the necessary permissions in both the source and target sites and to report if not, or, also grant the permission if missing?
- Validate if we already have appropriate permissions for this command
Is the requirement to check if the user executing the command has the necessary permissions in both the source and target sites and to report if not, or, also grant the permission if missing?
I would say just checking without granting.
I am wondering if we really need this additional check or let the command throw 'access denied' error if permissions are missing. Like m365 file add/list and many other commands.
yep. I agree. Not really sure what @appieschot had in mind 🤔. But I say trying and if the permission is not sufficient throwing an error is good enough for me 👍
Any different opinion @pnp/cli-for-microsoft-365-maintainers ?
@Adam-it I added that one as a note to validate if the CLI has enough permissions to do so (if we have the appropriate scope already). We do not need to have that in the command itself, just need to be sure we can call the Graph Endpoint to do so :-). I just checked and we have those permissions already: https://learn.microsoft.com/en-us/graph/api/driveitem-copy?view=graph-rest-1.0&tabs=http
@Saurabh7019 I guess should be no clear 👍 @appieschot thanks for the clarification
Thank you for clarifying. Can I work on it?
Usage
m365 file copy
Description
Copies 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
Copies a file using the graph
Default properties
No response
Additional Info
m365 file add
command using the Microsoft Graph this should be part of that command structure