spo file rename [options]
Renames a file
| Option | Description |
| ----------------------- | ----------------------------------------- |
-u, --webUrl <webUrl> | The URL of the site where the file is located
-s, --sourceUrl <sourceUrl> | Site-relative URL of the file to rename
-t, --targetFilename <targetFilename> | New Filename for the file to be renamed
--force | If a file already exists at the targetUrl, it will be moved to the recycle bin. If omitted, the move operation will be canceled if the file already exists at the targetUrl location
This could also be done with "spo file copy" if the
-t, --targetUrl
could include a new filename.
Nice suggestion! How about we rename deleteIfAlreadyExists to force since deleteIfAlreadyExists in the context of a rename operation sounds confusing?
Sure! The only think is what if you are trying to rename a.doc to b.doc, and b.doc already exists?
My guess (in the context of a CLI) is that the operation should fail, unless a flag is set, in which case, the operator is renaming the file to b.doc, knowing there's a possibility that b.doc already exists and expecting this new file to supercede all others.
The command should work exactly like you mentioned: if there is a file with the new name already and force was not specified, the command should fail. So the only change I'm proposing is using force instead of deleteIfAlreadyExists. Other than that we should follow your initial spec. Makes sense?
Makes sense?
Ah, yes. Perfect!
Hey @Chuckler22, sorry for dropping the ball on your proposal. Would you like to give it a try and implement it?
Hello!
I'm sorry to be the guy who requests/suggests a feature, and then gets a
new job where they don't do the thing that they used to do, but I guess I
am that guy.
Best of luck with the project!
Regards
Dean
On Sat, 2 Jan 2021 at 21:20, Waldek Mastykarz notifications@github.com
wrote:
Hey @Chuckler22 https://github.com/Chuckler22, sorry for dropping the
ball on your proposal. Would you like to give it a try and implement it?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/pnp/cli-microsoft365/issues/1763#issuecomment-753461631,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AQUXJW4N7UMGNNA2QJ3LFPLSX36PHANCNFSM4QCMLF3A
.
Life happens! No worries and thanks for your suggestion either way. I'm sure it will help others.
Good luck with the new job!
I am ready to take this one, please assign to me if possible
Most helpful comment
I am ready to take this one, please assign to me if possible