I just released PSNotes v1.0.0.

PSNotes is a PowerShell module that lets you build your own snippet library with:

  • Aliases for quick recall
  • Catalog-based organization
  • Direct execution or clipboard copy
  • Executing script via paths or as saved snippets
  • Support for remote catalogs allowing you to have your snippets everywhere
  • Quick browser to see all your notes at a glance
  • Works from Windows Terminal, VSCode, pwsh, or any PowerShell host (even ISE if you're still using that)

The goal is simple: make it easier to reuse the commands you run constantly and remember the ones you don’t. Or if you are like me and get sick of typing out [System.Collections.Generic.List[PSObject]] forty times a day.

Full documentation and samples: https://github.com/mdowst/PSNotes

Release notes: https://github.com/mdowst/PSNotes/releases/tag/v1.0.0

PowerShell Gallery Listing: https://www.powershellgallery.com/packages/PSNotes/1.0.0.0

I hope you find it useful. And as always, I'm open to any suggestions or feedback.

you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 5 months ago (1 child)

Wow, this is interesting!

My problem is it still relies on the human element working where it requires me to recognise I've done a cool thing, not move on to the next but instead consider how I'll need this in x months and should therefore store it somehow/where.

I've already got a huge-ass onenote of the frequent fliers, but the esoteric stuff still evades me

  • source
  • hideshow 2 child comments
  • [–] [S] 2 points 5 months ago (1 child)

    It's funny that you mention that because I'm already working on a solution around that. I'm working on a solution that will periodically backup the contents from your PSReadline history and save it in a searchable format. Then have a cmdlet like Search-History "whatever keywords". I'd like to make it a daemon so it could record estimated times and what console it executed from. I know it would save me a ton for searching.

    Also, my one huge-ass OneNote was the reason for me creating this. I found there were a few I kept going back for regularly and wanted a quicker way to get them. Glad to know I'm not the only one.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 4 months ago

    I search history like that:

    $psHistorySavePath = (Get-PSReadLineOption).HistorySavePath
    (gc $psHistorySavePath -Raw) -split '(?<=[^`])\r?\n' -replace '`\r?\n',"`n" -match 'ddrescue' | scb
    

    It puts all ddrescue commands to clipboard, which I paste into empty Kate tab. Split and replace are to handle multiline cmds

  • source
  • parent