Notion

0.7.0

Module for interaction with Notion based on classes

Minimum PowerShell version

7.0

There is a newer prerelease version of this module available.
See the version list below for details.

Installation Options

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

Install-Module -Name Notion -RequiredVersion 0.7.0

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

Install-PSResource -Name Notion -Version 0.7.0

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-NotionImageBlock New-NotionPdfBlock New-NotionVideoBlock New-NotionCodeBlock New-NotionColumnBlock New-NotionColumnListBlock New-NotionDividerBlock New-NotionEmbedBlock New-NotionEquationBlock New-NotionFileBlock Add-NotionHeaderToBlock New-NotionHeadingBlock 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-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.7.0] - 2025-06-19

### Added

- **.gitignore**
 - Added rules to exclude diff files (`*.diff`, `diff.*`) from version control.
- **source/Classes/Parent/00_parent.ps1**
 - Created Factory method `::new` to instantiate `notion_parent` objects from various input types.
- **source/Public/Parent/New-NotionParent.ps1**
 - New function to create `parent` objects (`page_id`, `database_id`, `block_id`, `wordspace`)
- **source/Private/Remove-NullValuesFromObject.ps1**
 - Added docs
- **source/Private/Test-NotionApiSettings.ps1**
 - New function to validate Notion API settings, ensuring `NotionApiKey`, `NotionApiUri` and `NotionApiVersion` are set.
- **source/Public/File/New-NotionFile.ps1**
 - New function to create `notion_file` objects, supporting various file types and rich text captions.
- **source/Public/Page/Get-NotionPage.ps1**
 - Added `-Raw` parameter to return raw JSON data from the Notion API, allowing for more flexible data handling.
 - Added check of API Parameters to ensure `NotionApiKey`, `NotionApiUri`, and `NotionApiVersion` are set before making API calls.
- **tests/Unit/Classes/00_General/00_icon.tests.ps1**
 - Added unit tests for `notion_icon` class, covering various input types and conversion methods.

### Changed

- **.vscode/profile.ps1**
 - Simplified directory change logic to always set location to the Notion module path.

- **.vscode/settings.json**
 - Removed custom terminal profile definition for Linux (`Notion pwsh`), likely to simplify or standardize terminal configurations.

- **build.ps1**
 - Simplified `gitversion` alias creation by unconditionally defining the alias to `dotnet-gitversion`, removing conditional logic.

- **source/Classes/03_File/01_notion_file.ps1**
 - Refactored `ConvertFromObject` logic to simplify type checking and error handling.
 - Removed unimplemented `file_upload` type handling.

- **source/Classes/03_File/03_external_file.ps1**
 - Removed redundant constructor that accepted only a URL, consolidating object creation pathways.

- **source/Public/Block/_RichText/New-NotionRichText.ps1**
 - Use handling in [richt_text] instead of maintaining separate logic in the cmdlet.

- **source/Public/Page/Get-NotionPageChildren.ps1**
 - Added connectivity check

### Fixed

- **source/Classes/00_General/00_icon.ps1**
 - Fixed `ConvertFromObject` to handle both string and object inputs correctly, ensuring robust icon handling.
 - Created factory method (::new) to instantiate `notion_icon` objects from various input types.
- **source/Classes/03_File/01_file.ps1**
 - Handle caption correctly in `ConvertFromObject`, ensuring its only processed if present.
- **source/Classes/03_File/02_hosted_file.ps1**
 - Added Constructor with two parameters: `url` and `expiry_time`, to support creation without caption and name.
 - Ensure the rich_text is converted correctly using `[rich_text]::ConvertFromObjects` for consistent rich text handling.
- **source/Classes/03_File/03_external_file.ps1**
 - Fixed `ConvertFromObject` to handle both string and object inputs correctly, ensuring robust external file handling.
 - Ensure rich_text is converted correctly using `[rich_text]::ConvertFromObjects` for consistent rich text handling.
- **source/Classes/Block/RichText/01_Rich_Text.ps1**
 - Fixed `ConvertFromObjects` to handle empty strings correctly (no conversion), and allow Object and
- **source/Public/Page/New-NotionPage.ps1**
 - Fixed `Icon` and `Cover` property handling
- **source/Private/Remove-NullValuesFromObject.ps1**
 - Fixed handling of empty strings and arrays only containing empty strings, ensuring they are removed from the object.

- **source/Public/Block/Paragraph/New-NotionParagraphBlock.ps1**
 - Fixed parameter handling, added example documentation

FileList

Version History

Version Downloads Last updated
0.10.0 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 (current version) 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 less