Skip to content

PoshlandPro/PSNotion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notion PowerShell Module

A PowerShell module for interacting with Notion API.

Installation

  • Install module from Powershell Gallery
Install-Module "PSNotion"

Usage

First configuration

  • Before using this module, you need to obtain an API Key from Notion. You can find instructions on how to do that in the Notion API Docs. You need to finished only steps 1 and 2 from the link. To use the module, first set your Notion API Key using the following command:
New-NotionConfig -Name MyFirstAccount -APIKey secret_iGxXXXXXXXXXXXXXXXXXXXXXXXXMpZ

First usage

When you import the module, default account will be fetch from secret vault.

[PS] >> Import-Module PSNotion
WARNING: Active Notion Account - MyFirstAccount
[PS] >> Find-NotionObject -ObjectType database
object           : database
id               : xxxxxxxx-yyyy-zzzz-vvvv-xxxxxxxxxxxx
cover            : 
icon             : 
created_time     : 30/01/2023 15:25:00
created_by       : @{object=user; id=xxxxxxxx-yyyy-zzzz-vvvv-xxxxxxxxxxxx}
last_edited_by   : @{object=user; id=xxxxxxxx-yyyy-zzzz-vvvv-xxxxxxxxxxxx}
last_edited_time : 06/02/2023 21:30:00
title            : {@{type=text; text=; annotations=; plain_text=Test Database; href=}}
description      : {}
is_inline        : False
properties       : @{Tags=; Name3=}
parent           : @{type=page_id; page_id=xxxxxxxx-yyyy-zzzz-vvvv-xxxxxxxxxxxx}
url              : https://www.notion.so/4aaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf
archived         : False

...

Cmdlets

  • Find-NotionObject: Get all databases or pages shared to your integration
  • Get-NotionDatabase: Retrieve a Notion database using database id.
  • Get-NotionPage: Retrieve a Notion pages.
  • Get-NotionPageContent: Retrieve a page blocks (page content)
  • New-NotionPage: Create a new page in a Notion.
  • Set-NotionBlock: Update an existing Notion block (a part of page content)
  • New-NotionConfig: Add new Notion account
  • Update-NotionConfig: Update a Notion account API Key
  • Set-NotionActiveAccount: Switch Notion account

Support

If you encounter any issues or have any suggestions, please open an issue in the GitHub repository.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published