Notion

0.10.0

Module for interaction with Notion based on classes

Minimum PowerShell version

7.0

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name Notion

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name Notion

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) Thomas Subotitsch, Fabian Franz Steiner. All rights reserved.

Package Details

Author(s)

  • Thomas Subotitsch Fabian Franz Steiner

Tags

Notion API Classes

Functions

New-NotionRichText New-NotionRichTextAnnotation New-NotionBookmarkBlock New-NotionBreadcrumbBlock New-NotionBulletedListItemBlock New-NotionCalloutBlock New-NotionChildPageBlock New-NotionChildDatabaseBlock New-NotionPdfBlock New-NotionVideoBlock New-NotionCodeBlock New-NotionColumnBlock New-NotionColumnListBlock New-NotionDividerBlock New-NotionEmbedBlock New-NotionEquationBlock New-NotionFileBlock Add-NotionHeaderToBlock New-NotionHeadingBlock New-NotionImageBlock New-NotionLinkPreviewBlock New-NotionNumberedListItemBlock New-NotionParagraphBlock New-NotionQuoteBlock New-NotionSyncedBlock New-NotionTableBlock New-NotionTableOfContentsBlock New-NotionTableRowBlock New-NotionToDoBlock New-NotionToggleBlock Add-NotionBlockToPage Get-NotionBlock Get-NotionBlockChildren New-NotionBlock Remove-NotionBlock Update-NotionBlock Add-NotionDatabaseProperty New-NotionDatabaseProperty Remove-NotionDatabaseProperty Add-NotionPageToDatabase Edit-NotionDatabase Get-NotionDatabase Move-NotionDatabaseToArchive New-NotionDatabase Remove-NotionDatabase Restore-NotionDatabase New-NotionEmoji New-NotionFile Get-NotionPageProperty Update-NotionPageProperty Get-NotionPage Get-NotionPageChildren Move-NotionPageToArchive New-NotionPage Remove-NotionPage Restore-NotionPage New-NotionParent Get-NotionUser Connect-Notion ConvertTo-NotionObject Disconnect-Notion Invoke-NotionApiCall zz1_Type_Accelerator zz2_Type_Accelerator

Dependencies

This module has no dependencies.

Release Notes

## [0.10.0] - 2025-06-27

### Added

- **`.devcontainer/setup.ps1`**
 - Added logic to ensure the `.dotnet/tools` directory is prepended to `$env:PATH` if not already present, improving the reliability of dotnet tool availability in devcontainers.

- **`GitVersion.yml`**
 - Updated the `hotfix` branch regex to also match `bugfix` prefixes, enhancing support for multiple fix naming conventions.

- **`source/Private/Invoke-TransposeTable.ps1`**
 - Introduced `Invoke-TransposeTable`, a utility function that transposes a 2D array. Useful for converting row-major to column-major formats.

- **`source/Public/Block/Image/New-NotionImageBlock.ps1`**
 - Implemented `New-NotionImageBlock` to construct a `notion_image_block` from a file input.

- **`tests/Integration/Block/table.tests.ps1`**
 - Added integration tests verifying creation of table blocks with structured content.

- **`tests/QA/ModulePrefix.Tests.ps1`**
 - Introduced QA test to enforce module function naming conventions using `Verb-PrefixFunctionName` pattern.

- **`tests/Unit/Classes/Block/27.99_Table.tests.ps1`**
 - Added comprehensive unit tests for `Table_structure` and `notion_table_block` classes, covering constructors, methods, and conversion behavior.

- **`tests/Unit/Private/Invoke-TransposeTable.Tests.ps1`**
 - Introduced unit tests for `Invoke-TransposeTable`, validating matrix transposition and error handling for invalid input.

- **`tests/Unit/Public/Block/New-NotionTableBlock.Tests.ps1`**
 - Added extensive unit tests for `New-NotionTableBlock`, validating behavior across input types, flags, and edge cases.

### Changed

- **`source/Classes/Block/21_Image.ps1`**
 - Enhanced `notion_image_block.ConvertFromObject` to handle both `notion_file` objects and plain objects, improving robustness.

- **`source/Classes/Block/27.2_TableRow.ps1`**
 - Updated `TableRow_structure.ConvertFromObject` to short-circuit if input is already a `TableRow_structure` instance, avoiding unnecessary processing.

- **`source/Classes/Block/27.99_Table.ps1`**
 - Modified `addRow` and `addRows` to set `has_children` flag when adding rows, ensuring block state consistency.

- **`source/Public/Block/_RichText/New-NotionRichText.ps1`**
 - Updated the `Annotations` parameter to inherit defaults from parent object when unspecified.

- **`tests/Integration/Block/callout.tests.ps1`**
 - Adjusted emoji and color properties of callout blocks to align with expected test results.

- **`tests/Unit/Classes/Page/PageProperties/pp_checkbox.Tests.ps1`**
 - Fixed path resolution logic to correct import of project resources.

- **`tests/Unit/Classes/Parent/parent.Tests.ps1`**
 - Improved error handling for invalid parent types in `notion_parent.ConvertFromObject`.

### Fixed

- **`source/Public/Block/Table/New-NotionTableBlock.ps1`**
 - Renamed function from `New-NotionTable` to `New-NotionTableBlock` and significantly refactored its logic to support structured inputs (e.g., hashtables).
 - Corrected behavior for handling column and row headers.
 - Added support for optional pivoting of data and validation of inputs.

- **`source/Public/Block/TableRow/New-NotionTableRowBlock.ps1`**
 - Renamed function from `New-NotionTableRow` to `New-NotionTableRowBlock` and updated references to match, ensuring correct module export and functionality.

FileList

Version History

Version Downloads Last updated
0.10.0 (current version) 4 6/27/2025
0.9.0-previe... 3 6/24/2025
0.9.0-previe... 3 6/24/2025
0.8.0 11 6/23/2025
0.7.0 5 6/19/2025
0.6.0 5 6/16/2025
0.5.0 5 6/14/2025
0.5.0-previe... 3 6/14/2025
0.4.0 4 6/14/2025
0.4.0-previe... 3 6/4/2025
0.4.0-previe... 3 5/29/2025
0.4.0-previe... 3 5/29/2025
0.3.0 8 5/18/2025
0.2.0 5 5/18/2025
0.2.0-previe... 3 5/2/2025
0.2.0-previe... 3 3/24/2025
0.2.0-previe... 3 3/24/2025
0.2.0-previe... 3 3/24/2025
0.2.0-previe... 3 3/2/2025
0.2.0-previe... 3 3/2/2025
0.2.0-previe... 3 2/22/2025
0.2.0-previe... 3 2/22/2025
Show more