You should add a shortcut that points to the file location
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File C:\Users\USER\Desktop\notion-inbox.ps1
| $NotionAPIKey="" | |
| $DatabaseID="" | |
| $Notionheaders = @{ | |
| "Authorization" = "Bearer $($NotionAPIKey)" | |
| "Content-type" = "application/json" | |
| "Notion-Version" = "2021-08-16" | |
| } | |
| function Post-To-Inbox { | |
| $Input = Read-Host -Prompt 'Inbox:' | |
| $json='{ | |
| "parent":{ | |
| "database_id":"$[DATABASE_ID]" | |
| }, | |
| "properties":{ | |
| "Name":{ | |
| "title":[ | |
| { | |
| "text":{ | |
| "content":"$[TEXT]" | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }'.replace('$[TEXT]',$Input).replace('$[DATABASE_ID]',$DatabaseID) | |
| if ($Input) { | |
| $Result = Invoke-RestMethod -Uri "https://api.notion.com/v1/pages" -Method Post -Headers $Notionheaders -Body $json | |
| Post-To-Inbox | |
| } else { | |
| exit; | |
| } | |
| } | |
| Post-To-Inbox |