Skip to content
Open
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
29 changes: 29 additions & 0 deletions .devproxy/api-specs/sharepoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,30 @@ paths:
responses:
200:
description: OK
/_api/web/GetFolderById({folderId}):
get:
parameters:
- name: folderId
in: path
required: true
description: folder unique ID
schema:
type: string
example: "'b2307a39-e878-458b-bc90-03bc578531d6'"
security:
- delegated:
- AllSites.Read
- AllSites.Write
- AllSites.Manage
- AllSites.FullControl
- application:
- Sites.Read.All
- Sites.ReadWrite.All
- Sites.Manage.All
- Sites.FullControl.All
responses:
200:
description: OK
/_api/web/GetFolderByServerRelativePath(DecodedUrl={folderPath}):
get:
parameters:
Expand All @@ -326,6 +350,11 @@ paths:
- AllSites.Write
- AllSites.Manage
- AllSites.FullControl
- application:
- Sites.Read.All
- Sites.ReadWrite.All
- Sites.Manage.All
- Sites.FullControl.All
responses:
200:
description: OK
Expand Down
68 changes: 68 additions & 0 deletions docs/docs/cmd/spo/folder/folder-archive.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import Global from '../../_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spo folder archive

Archives a folder

## Usage

```sh
m365 spo folder archive [options]
```

## Options

```md definition-list
`-u, --webUrl <webUrl>`
: The URL of the site where the folder is located.

`--url [url]`
: The server- or site-relative decoded URL of the folder to archive. Specify either `url` or `id`, but not both.

`-i, --id [id]`
: The UniqueId (GUID) of the folder to archive. Specify either `url` or `id`, but not both.

`-f, --force`
: Don't prompt for confirmation.
```

<Global />

## Permissions

<Tabs>
<TabItem value="Delegated">

| Resource | Permissions |
|------------|----------------|
| SharePoint | AllSites.Write |

</TabItem>
<TabItem value="Application">

| Resource | Permissions |
|------------|---------------------|
| SharePoint | Sites.ReadWrite.All |

</TabItem>
</Tabs>

## Examples

Archive a folder by id without prompting for confirmation

```sh
m365 spo folder archive --webUrl https://contoso.sharepoint.com/sites/Marketing --id 7a8c9207-7745-4cda-b0e2-be2618ee3030 --force
```

Archive a folder by URL with prompting for confirmation

```sh
m365 spo folder archive --webUrl https://contoso.sharepoint.com/sites/Marketing --url '/sites/Marketing/shared documents/folder'
```

## Response

The command won't return a response on success.
5 changes: 5 additions & 0 deletions docs/src/config/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2860,6 +2860,11 @@ const sidebars: SidebarsConfig = {
label: 'folder add',
id: 'cmd/spo/folder/folder-add'
},
{
type: 'doc',
label: 'folder archive',
id: 'cmd/spo/folder/folder-archive'
},
{
type: 'doc',
label: 'folder copy',
Expand Down
1 change: 1 addition & 0 deletions src/m365/spo/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default {
FILE_VERSION_REMOVE: `${prefix} file version remove`,
FILE_VERSION_RESTORE: `${prefix} file version restore`,
FOLDER_ADD: `${prefix} folder add`,
FOLDER_ARCHIVE: `${prefix} folder archive`,
FOLDER_COPY: `${prefix} folder copy`,
FOLDER_GET: `${prefix} folder get`,
FOLDER_LIST: `${prefix} folder list`,
Expand Down
Loading
Loading