Notion

0.4.0-preview0018

Module for interaction with Notion based on classes

Minimum PowerShell version

7.0

This is a prerelease version of Notion.

Installation Options

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

Install-Module -Name Notion -AllowPrerelease

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

Install-PSResource -Name Notion -Prerelease

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-NotionBookmarkBlock New-NotionBreadcrumbBlock New-NotionBulletedListItemBlock New-NotionCalloutBlock New-NotionChildDatabaseBlock New-NotionChildPageBlock New-NotionCodeBlock New-NotionColumnBlock New-NotionColumnListBlock New-NotionDividerBlock New-NotionEmbedBlock New-NotionEquationBlock New-NotionFileBlock New-NotionImageBlock New-NotionLinkPreviewBlock New-NotionNumberedListItemBlock New-NotionParagraphBlock New-NotionPdfBlock New-NotionQuoteBlock New-NotionSyncedBlock New-NotionTableBlock New-NotionTableOfContentsBlock New-NotionTableRowBlock New-NotionToDoBlock New-NotionToggleBlock New-NotionVideoBlock Add-NotionHeaderToBlock New-NotionHeader New-NotionTable New-NotionTableRow 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 Get-NotionPageProperty Update-NotionPageProperty Get-NotionPage Get-NotionPageChildren Move-NotionPageToArchive New-NotionPage Remove-NotionPage Restore-NotionPage 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.4.0-preview0018] - 2025-06-04

### Added

- `.vscode/settings.json`: added `terminal.integrated.bracketedPasteMode`, disabled minimap, and configured custom terminal profile
- `.vscode/profile.ps1`: PowerShell profile to auto-import the module during development
- `.vscode/vsicons-custom-icons/`: added custom icon support for Pester files
- `.build/Copy-WikiContent.ps1`: script to copy wiki content from source to destination, flattening structure
- `.build/New-WikiSidebarFromPs1.ps1`: script to generate `_Sidebar.md` from PowerShell and Markdown files
- `.build/README.md`: documentation for adding custom build tasks and workflows
- `build.yaml`: added `minibuild` task with steps for `Clean`, `Build_Module_ModuleBuilder`, and `Build_NestedModules_ModuleBuilder`
- `source/Classes/03_File/01_notion_file.ps1`:  
 - Added static `Create` method to instantiate child objects based on file type
- `source/Classes/Block/RichText/01_Rich_Text.ps1`:  
 - Added `ConvertFromObjects` method to convert arrays or single objects into `rich_text[]`
- `source/Classes/Block/04_Block.ps1`:  
 - Improved error messages for unsupported and unknown block types with GitHub issue link and quoted block type
- `source/Classes/Block/05_Bookmark.ps1`:  
 - Refactored constructors to support flexible input types and added `ConvertFromObject` method
- `source/Classes/Block/07_Bulleted_List_Item.ps1`:  
 - Refactored constructors to use `ConvertFromObjects` and support flexible input
- `source/Classes/Block/08_Callout.ps1`:  
 - Refactored constructors and added `ConvertFromObject` for emoji and rich text
- `source/Classes/Block/09_Child_Database.ps1`:  
 - Used `ConvertFromObject` for `child_database_structure`
- `source/Classes/Block/10_Child_Page.ps1`:  
 - Used `ConvertFromObject` for `child_page_structure`
- `source/Classes/Block/11_Code.ps1`:  
 - Refactored constructors to use `ConvertFromObjects` and support caption
- `source/Classes/Block/15_Embed.ps1`:  
 - Added support for `caption` and `ConvertFromObject` improvements
- `source/Classes/Block/16_Equation.ps1`:  
 - Renamed constructors to match class name
- `source/Classes/Block/21_Image.ps1`:  
 - Added support for `caption` and improved `ConvertFromObject`
- `source/Classes/Block/31_To_do.ps1`:  
 - Refactored constructor to remove base call
- `source/Classes/Block/33_Video.ps1`:  
 - Refactored constructors to use `Create` method and support caption
- `source/Classes/Emoji/01_emoji.ps1`:  
 - Added `ConvertFromObject` method to handle strings and emoji objects
- `tests/Integration/Block/testpage.tests.ps1`:  
 - Improved test logic for unsupported block types with specific error message checks
- `source/Public/Block/New-NotionBlock.ps1`: generic factory function to create Notion blocks
- `source/Public/Block/Cmds/*`: added many new `New-Notion*Block.ps1` cmdlets for block creation (e.g., `Bookmark`, `Callout`, `ChildPage`, `Code`, etc.)
- `docs/Enums/`: added Markdown documentation for all enums used in the module
- `source/WikiSource/`: added wiki source files including setup guide, FAQ, and integration images
- `tests/Unit/Classes/Block/`: added unit tests for many block classes (e.g., `Bookmark`, `Breadcrumb`, `Callout`, `Code`, `Image`, `Video`, etc.)

### Changed

- `RequiredModules.psd1`: switched to Pester Version 6
- `.vscode/analyzersettings.psd1`: relaxed some analyzer rules (e.g., allow `Write-Host`)
- `.github/ISSUE_TEMPLATE/`: updated templates to reflect support for commands, classes, and enums
- `README.md`: added badges, logo, and improved getting started section
- `build.ps1`: added tasks `Generate_Wiki_Sidebar_From_Ps1` and `Copy_Wiki_Content_Custom`
- Refactored multiple constructors across block classes to support more flexible input types and use `ConvertFromObjects` for consistency
- `source/Classes/Emoji/01_emoji.ps1`: improved emoji conversion logic
- `source/Enum/*`: added missing enum values and documentation links

### Fixed

- `source/Enum/01_notion_color.ps1`: added `default_background` as a color (missing in documentation but available in API)
- `source/Classes/Block/32_Toggle.ps1`: fixed class name and constructor
- `source/Classes/Block/33_Video.ps1`: fixed constructors and file instantiation logic
- `source/Classes/Block/05_Bookmark.ps1`:  
 - Fixed constructors  
 - `bookmark_structure`: fixed constructor with two parameters to fully support `rich_text`
- `source/Classes/Block/07_Bulleted_List_Item.ps1`:  
 - Fixed `rich_text` conversion in constructors
- `source/Classes/Block/08_Callout.ps1`:  
 - Fixed constructors and emoji handling
- `source/Classes/Emoji/01_emoji.ps1`:  
 - Fixed `ConvertFromObject` to handle strings and emoji objects
- `tests/Integration/Block/testpage.tests.ps1`: improved error handling and validation for unsupported block types
- `tests/Integration/PageProperties/testpage.tests.ps1`: added validation for page property types

FileList

Version History

Version Downloads Last updated
0.4.0-previe... (current version) 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