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

Adds command 'spo page section remove'. Closes #6541 #6606

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
47 changes: 47 additions & 0 deletions docs/docs/cmd/spo/page/page-section-remove.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spo page section remove

Removes the specified section from a modern page

## Usage

```sh
m365 spo page section remove [options]
```

## Options

```md definition-remove
`-u, --webUrl <webUrl>`
: URL of the site where the page is located.

`-n, --pageName <pageName>`
: Name of the page from which to remove a section.

`-s, --section <section>`
: ID of the section to be removed.

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

<Global />

## Remarks

If the specified `pageName` doesn't refer to an existing modern page, you will get a _File doesn't exists_ error.

## Examples

Remove section of a modern page

```sh
m365 spo page section remove --webUrl https://contoso.sharepoint.com/sites/team-a --pageName home.aspx --section 1
```

## 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 @@ -3384,6 +3384,11 @@ const sidebars: SidebarsConfig = {
label: 'page section list',
id: 'cmd/spo/page/page-section-list'
},
{
type: 'doc',
label: 'page section remove',
id: 'cmd/spo/page/page-section-remove'
},
{
type: 'doc',
label: 'page template list',
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 @@ -221,6 +221,7 @@ export default {
PAGE_SECTION_ADD: `${prefix} page section add`,
PAGE_SECTION_GET: `${prefix} page section get`,
PAGE_SECTION_LIST: `${prefix} page section list`,
PAGE_SECTION_REMOVE: `${prefix} page section remove`,
PAGE_TEMPLATE_LIST: `${prefix} page template list`,
PAGE_TEMPLATE_REMOVE: `${prefix} page template remove`,
PAGE_TEXT_ADD: `${prefix} page text add`,
Expand Down
Loading
Loading