Back to all posts

AI Is A Flawed Teacher For Learning PowerShell

2025-09-21Richard Devine3 minutes read
AI
PowerShell
Coding

I've embraced using AI, particularly conversational chatbots like Copilot, as a tool for learning new subjects. The back-and-forth nature of AI chats feels more intuitive for research than a standard web search, reminiscent of interacting with a teacher. This is the method I chose when I finally decided to tackle PowerShell, a scripting language I've long been curious about. My approach is simple: learn by asking questions, experimenting, and fixing what breaks.

However, my experience quickly revealed a crucial truth: AI, in its current state, is no substitute for a human expert. It's not a magical solution, and for a beginner like me, relying on it without supervision can lead to a lot of broken code.

Asking Google Gemini about executing word count using PowerShell

Starting the Learning Journey

To begin, I set a small, manageable goal: create a custom PowerShell profile. I had a basic idea of its purpose, similar to a .bashrc file on Linux, but needed guidance on what to include. I used Google Gemini to get ideas and understand the concepts.

My project goals were to add the following features to my profile:

  • Enable PSReadLine for command history and intellisense.
  • Invoke the Starship prompt for a customized look.
  • Display system information using Fastfetch upon startup.
  • Add a cooldown so Fastfetch doesn't run every single time I open a new tab.
  • Create a simple word count function aliased to the command "wc".

Except for the Starship command, which is provided by the tool's developers, I relied on AI to generate the necessary scripts and explain how each part worked.

PSReadLine history in PowerShell

The Trial and Error of AI-Assisted Coding

The process quickly demonstrated that you can't just ask an AI to write code and expect it to work perfectly. The initial scripts failed. But this failure became a core part of the learning process. I had to troubleshoot by feeding the error messages back to the AI, asking for explanations, and iterating on the solution.

This back-and-forth taught me valuable lessons. For instance, I learned about the subtle but important differences between PowerShell 7 and the older Windows PowerShell, which was a source of some errors. I also gained a practical understanding of how to create and use functions. While it wasn't true debugging, the cycle of testing, failing, and refining my prompts helped solidify my understanding.

Ultimately, I achieved my goal and got the profile working as intended, but it was a journey of trial and error.

Using Codestral in LM Studio to evaluate a PowerShell script

Why Human Expertise Still Reigns Supreme

This simple project was enough to prove that AI is not ready to replace human coders. An experienced PowerShell developer would have spotted the flaws in the AI's initial code immediately. For me, it took a significant amount of time to diagnose and fix the issues through conversation with the AI.

The experience highlights AI's ideal role: a tool to make experts more efficient, not a replacement for them. AI can help quickly draft a function, but a knowledgeable human is still needed to validate, refine, and correct its output.

I plan to continue using AI on my learning path, but it's clear that for quality results, technology needs to be built to work with human experts, not sideline them. For those interested, you can view my final PowerShell profile script on GitHub and offer constructive feedback.

PSReadLine history in PowerShell running in Windows Terminal

Read Original Post
ImaginePro newsletter

Subscribe to our newsletter!

Subscribe to our newsletter to get the latest news and designs.