Get NotionBlock - fasteiner/Notion GitHub Wiki


Category: Commands external help file: Notion-help.xml Module Name: Notion online version: https://developers.notion.com/reference/get-block-children schema: 2.0.0 Type: Command

Get-NotionBlock

SYNOPSIS

Retrieves a Notion block and its children up to a specified depth.

SYNTAX

Object

Get-NotionBlock -Block <notion_block> [-maxDepth <Object>] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

ID

Get-NotionBlock -BlockId <String> [-maxDepth <Object>] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

The Get-NotionBlock function retrieves a Notion block and its children up to a specified depth. It can accept either a block object or a block ID as input.

EXAMPLES

EXAMPLE 1

$block = Get-NotionBlock -BlockId "some-block-id" -maxDepth 3

EXAMPLE 2

$block = Get-NotionBlock -Block $someBlockObject -maxDepth 2

PARAMETERS

-Block

The block to get the children from. This parameter is mandatory if using the "Object" parameter set.

Type: notion_block
Parameter Sets: Object
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-BlockId

The block ID to get the children from. This parameter is mandatory if using the "ID" parameter set.

Type: String
Parameter Sets: ID
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-maxDepth

The maximum depth of children to retrieve. The default value is 5.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 5
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

[notion_block]

Returns a notion_block object representing the specified block and its children.

NOTES

This function requires the Invoke-NotionApiCall and Get-NotionBlockChildren functions to be defined.

RELATED LINKS

https://developers.notion.com/reference/get-block-children

⚠️ **GitHub.com Fallback** ⚠️