Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves 'spo folder copy' to new endpoint #6438

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 84 additions & 13 deletions docs/docs/cmd/spo/folder/folder-copy.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spo folder copy

Expand Down Expand Up @@ -31,19 +33,14 @@ m365 spo folder copy [options]
`--nameConflictBehavior [nameConflictBehavior]`
: Behavior when a file or folder with the same name is already present at the destination. Allowed values: `fail`, `rename`. Defaults to `fail`.

`--resetAuthorAndCreated`
: Use this option to clear the author and created date. When not specified, the values from the source folder are used.

`--bypassSharedLock`
: This indicates whether a folder with a shared lock can still be moved. Use this option to copy a folder that is locked.
`--skipWait`
: Don't wait for the copy operation to complete.
```

<Global />

## Remarks

When you copy a folder with documents that have version history, only the latest document version is copied.

When you specify a value for `nameConflictBehavior`, consider the following:

- `fail` will throw an error when the destination folder already exists.
Expand All @@ -69,16 +66,90 @@ Copy a folder to another location and use new name on conflict
m365 spo folder copy --webUrl https://contoso.sharepoint.com/sites/project-x --sourceUrl "/sites/project-x/Shared Documents/Reports" --targetUrl "/sites/project-y/Shared Documents/Project files" --nameConflictBehavior rename
```

Copy a folder referenced by its ID to another document library and reset author and created date
Copy a folder referenced by its ID to another document library and don't wait for the copy operation to finish

```sh
m365 spo folder copy --webUrl https://contoso.sharepoint.com/sites/project-x --sourceId b8cc341b-9c11-4f2d-aa2b-0ce9c18bcba2 --targetUrl "/sites/project-x/Project files" --retainEditorAndModified
m365 spo folder copy --webUrl https://contoso.sharepoint.com/sites/project-x --sourceId b8cc341b-9c11-4f2d-aa2b-0ce9c18bcba2 --targetUrl "/sites/project-x/Project files" --skipWait
```

## Response

The command won't return a response on success.
### Standard Response

<Tabs>
<TabItem value="JSON">

```json
{
"Exists": true,
"ExistsAllowThrowForPolicyFailures": true,
"ExistsWithException": true,
"IsWOPIEnabled": false,
"ItemCount": 6,
"Name": "Company",
"ProgID": null,
"ServerRelativeUrl": "/sites/Sales/Icons/Company",
"TimeCreated": "2024-09-26T22:08:53Z",
"TimeLastModified": "2024-09-26T22:09:31Z",
"UniqueId": "d3a37396-ca16-467b-b968-48f5fc41f2b6",
"WelcomePage": ""
}
```

</TabItem>
<TabItem value="Text">

```text
Exists : true
ExistsAllowThrowForPolicyFailures: true
ExistsWithException : true
IsWOPIEnabled : false
ItemCount : 6
Name : Company
ProgID : null
ServerRelativeUrl : /sites/Sales/Icons/Company
TimeCreated : 2024-09-26T22:08:53Z
TimeLastModified : 2024-09-26T22:09:31Z
UniqueId : d3a37396-ca16-467b-b968-48f5fc41f2b6
WelcomePage :
```

</TabItem>
<TabItem value="CSV">

```csv
Exists,ExistsAllowThrowForPolicyFailures,ExistsWithException,IsWOPIEnabled,ItemCount,Name,ProgID,ServerRelativeUrl,TimeCreated,TimeLastModified,UniqueId,WelcomePage
1,1,1,0,6,Company,,/sites/Sales/Icons/Company,2024-09-26T22:08:53Z,2024-09-26T22:09:31Z,d3a37396-ca16-467b-b968-48f5fc41f2b6,
```

</TabItem>
<TabItem value="Markdown">

```md
# spo folder copy --webUrl "https://contoso.sharepoint.com/sites/Marketing" --sourceUrl "/Logos/Contoso" --targetUrl "/sites/Sales/Logos"

Date: 18/10/2024

## Company (d3a37396-ca16-467b-b968-48f5fc41f2b6)

Property | Value
---------|-------
Exists | true
ExistsAllowThrowForPolicyFailures | true
ExistsWithException | true
IsWOPIEnabled | false
ItemCount | 6
Name | Company
ServerRelativeUrl | /sites/Sales/Icons/Company
TimeCreated | 2024-09-26T22:08:53Z
TimeLastModified | 2024-09-26T22:09:31Z
UniqueId | d3a37396-ca16-467b-b968-48f5fc41f2b6
WelcomePage |
```

</TabItem>
</Tabs>

### `skipWait` response

## More information

- Copy items from a SharePoint document library: [https://support.office.com/en-us/article/move-or-copy-items-from-a-sharepoint-document-library-00e2f483-4df3-46be-a861-1f5f0c1a87bc](https://support.office.com/en-us/article/move-or-copy-items-from-a-sharepoint-document-library-00e2f483-4df3-46be-a861-1f5f0c1a87bc)
The command won't return a response on success.
8 changes: 4 additions & 4 deletions docs/docs/v10-upgrade-guidance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,13 @@ In the past versions of CLI for Microsoft 365, the command had no output. When u

When using the [spo file move](./cmd/spo/file/file-move.mdx) command, please use the new command input. This means that you'll have to remove option `--retainEditorAndModified` from your scripts and automation tools.

### Updated command `spo folder move`
### Updated command `spo folder move` and `spo folder copy`

Because of some limitations of the current [spo folder move](./cmd/spo/folder/folder-move.mdx) command, we have decided to move it to a new endpoint. This change is necessary to ensure the command's functionality and reliability. Because of the new endpoint, the command input and output have changed.
Because of some limitations of the current commands [spo folder move](./cmd/spo/folder/folder-move.mdx) and [spo folder copy](./cmd/spo/folder/folder-copy.mdx), we have decided to move it to a new endpoint. This change is necessary to ensure the command's functionality and reliability. Because of the new endpoint, the command's input and output have changed.

**Command options:**

Unfortunately, we had to drop the `--retainEditorAndModified` and `--bypassSharedLock` options as it's no longer supported by the new endpoint. In return, we were able to add a new option:
Unfortunately, we had to drop the `--retainEditorAndModified`, `--resetAuthorAndCreated` and `--bypassSharedLock` options as it's no longer supported by the new endpoint. In return, we were able to add a new option:
- `--skipWait`: Don't wait for the move operation to complete.

**Command output:**
Expand All @@ -253,7 +253,7 @@ In the past versions of CLI for Microsoft 365, the command had no output. When u

#### What action do I need to take?

When using the [spo folder move](./cmd/spo/folder/folder-move.mdx) command, please use the new command input. This means that you'll have to remove options `--retainEditorAndModified` and `--bypassSharedLock` from your scripts and automation tools.
When using these commands, please use the new command input. This means that you'll have to remove options `--retainEditorAndModified`, `--resetAuthorAndCreated` and `--bypassSharedLock` from your scripts and automation tools.

### Removed `spo folder rename` alias

Expand Down
Loading