Spo file copy updated#705
Conversation
|
Thank you! I'll review it shortly |
waldekmastykarz
left a comment
There was a problem hiding this comment.
When trying to use the command, I'm getting a File not found error.
Repro:
spo file copy -u https://contoso.sharepoint.com/sites/marketing -s /Shared%20Documents/BrandingElements.png -t /sites/sales/Shared%20DocumentsIt seems that the command generated invalid URL in the CreateCopyJobs payload:
CreateCopyJobs request...
body : {"exportObjectUris":["https://contoso.sharepoint.com/sites/Shared%20Documents/BrandingElements.png"],"destinationUri":"https://contoso.sharepoint.com/sites/sales/Shared%20Documents","options":{"AllowSchemaMismatch":false,"IgnoreVersionHistory":true}}
headers: {"authorization":"Bearer eyJ0eXAiOiJKV1QiLCJhbGc...","accept":"application/json;odata=nometadata","User-Agent":"NONISV|SharePointPnP|Office365CLI/1.11.0"}
json : true
url : https://contoso.sharepoint.com/sites/marketing/_api/site/CreateCopyJobs
I also tried running
spo file copy -u https://contoso.sharepoint.com/sites/marketing -s Shared%20Documents/BrandingElements.png -t /sites/sales/Shared%20Documentsand
spo file copy -u https://contoso.sharepoint.com/sites/marketing -s "/Shared Documents/BrandingElements.png" -t /sites/sales/Shared%20DocumentsBut in all cases I'm getting the same error
waldekmastykarz
left a comment
There was a problem hiding this comment.
Nicely done with a few things I've fixed when merging the PR
| sourceUrl: string; | ||
| targetUrl: string; | ||
| deleteIfAlreadyExists?: boolean; | ||
| allowSchemaMismatch: boolean; |
There was a problem hiding this comment.
allowSchemaMismatch should be optional
| `-t, --targetUrl <targetUrl>`|Server-relative URL where to copy the file | ||
| `--deleteIfAlreadyExists`|If a file already exists at the targetUrl, it will be moved to the recycle bin. If omitted, the copy operation will be canceled if the file already exists at the targetUrl location | ||
| `--deleteIfAlreadyExists`|If a file already exists at the targetUrl, it will be moved to the recycle bin. If omitted, the copy | ||
| operation will be canceled if the file already exists at the targetUrl location |
There was a problem hiding this comment.
Breaking lines in a table in MD breaks formatting creating a new row. Instead, the whole description should be in one line
| ``` | ||
|
|
||
| Copy file to a document library in another site collection. Allow for schema mismatch | ||
| ```sh |
There was a problem hiding this comment.
There should be an empty line between the text and code block. Additionally, the code block shouldn't be indented
| spo file copy --webUrl https://contoso.sharepoint.com/sites/test1 --sourceUrl /Shared%20Documents/sp1.pdf --targetUrl /sites/test2/Shared%20Documents/ --deleteIfAlreadyExists | ||
| ``` | ||
|
|
||
| Copy file to a document library in another site collection. Allow for schema mismatch |
There was a problem hiding this comment.
This content is different from the help included in command. Both should be the same
|
Merged manually. Thanks! |
Made a few changes to match the changes made in
spo file moveandspo folder move