Show HN: I Wrote an AI PowerShell Refiner
shaunlawrie.comI’ve been having fun generating code via LLMs but getting frustrated with the common pitfalls (hallucinated functions, parameters, mixed up language constructs etc.). I use PowerShell a lot in my daily work so I built something to help generate a lot of boilerplate code I need. I’ve used the PS abstract syntax tree to parse the LLM output and validate that common issues aren’t present, if they are it gets auto-corrected and it also uses the LLM to ensure the logic is still sound after correcting syntax issues.
I probably spent more time writing the terrible in-terminal syntax highlighter than working on the AI side of things Very cool. I too use PowerShell in my daily work and have found ChatGPT to be quite good, although it has made some mistakes. I’ll give this a try. I wonder if this could be also accomplished by providing GPT the algorithm at the end of your article, as a preamble to each request for a function. If so, was this made into a module because it fits your workflow better? I built it into the existing PowerShellAI module because I was learning as I went and I was already using it. The module already has quite a bit of adoption too so I figure it’s a good way to find bugs and get some feedback. Just launch it to a few hundred people and see what works.