No posts for a while, for two main reasons.
- Working on a PowerShell module – my first attempt at a module rather than a quick-and-dirty script.
All of this was triggered by an intersection of two of my favourite Microsoft products. PowerShell and OneNote (+ some lethargy).
I had been doing some work in PowerShell and wanted to capture the results in OneNote; preferably to a nice tabular layout. Something like:
Get-SomeObject | Out-OneNote
With the result being a nice new page containing a tabular representation of the objects in question. No dice I’m afraid. You can export to text, you can do a OneNote printout using the OneNote printer driver (resulting in an image) but you can’t pipe objects into OneNote. I was too lazy to use any of the (complicated in my view) workarounds – so it was time for a script.
I use the desktop version of OneNote by preference on PCs – so this meant I could avoid wrestling with REST and use a good old-fashioned COM API. This initial idea of Out-OneNote quickly became a set of utility functions for accessing the OneNote object model and the OneNoteUtilities module was born. At the moment I have a few different functions available. Here are some names to wet your appetites:
CommandType Name Version Source
———– —- ——- ——
Function Get-ONHierarchy 0.0 OneNoteUtilities
Function Get-ONNoteBook 0.0 OneNoteUtilities
Function Get-ONNoteBooks 0.0 OneNoteUtilities
Function Get-ONPage 0.0 OneNoteUtilities
Function Get-ONPages 0.0 OneNoteUtilities
Function Get-ONSections 0.0 OneNoteUtilities
Function New-ONElement 0.0 OneNoteUtilities
Function New-ONPage 0.0 OneNoteUtilities
The eventual aim will be to publish via GitHub and possibly the PowerShell Gallery.