News for hackers. Stuff that matters.

Show HN: I Wrote an AI PowerShell Refiner

https://shaunlawrie.com/blog/powershellai/

I’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

( 2 comments | on HN )
Re:Show HN: I Wrote an AI PowerShell Refiner by replwoacause on Wednesday April 19, 2023 @02:23PM (#35631536)
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?
Re:Show HN: I Wrote an AI PowerShell Refiner by BasiliusCarver on Wednesday April 19, 2023 @03:49PM (#35632502)
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.