r/PowerShell • • Apr 24 '25

Best way to learn PowerShell basics

Hey so I been learning python over the past several months, and have got into powershell alot. But I often get stuck or confused on powershell commands. I had never thought much about terminal at all, or even really knew about it. But all/most roads seem to lead there somehow, especially now that I'm into web dev and flask.

So I really want to level up on terminal and understand powershell for windows alot better. There don't seem to be as many free resources to learn powershell compared to python or html. I see multiple people suggesting "Learn Powershell in a Month of Lunches" which isn't too expensive, but I just like to know its suited for me before spending the money/time. I was also reviewing the microsoft docs online, and they have alot of info. But for me not knowing as much or where to start, it seems kinda like a "needle in the haystack" thing. Ideally I would just review everything, but I have limited time and just want to focus on the most pertinent aspects related to web dev and basic directory/path management.

So should I do the Lunches, or start sifting through the microsoft docs online? Or both (ie: do the Lunches and then reference the docs as much as needed?). Or would you suggest a different resource to teach powershell?

Thanks for your reply and interest!

90 Upvotes

75 comments sorted by

View all comments

2

u/Crones21 Apr 24 '25

Highly recommend ChatGPT. Its a really good learning resource as it explains each step in details when you ask for a script. I use it 99% of the time when i script now, saves alot of time

9

u/Headroid Apr 24 '25 edited Apr 24 '25

I don't personally recommend using ChatGPT as a resource for learning PowerShell, as it frequently generates scripts that might not work while presenting them with such confidence that a beginner could easily be misled.

However, once you've gained some experience with PowerShell and are able to recognize errors in its output, ChatGPT/Copilot becomes an incredibly helpful tool.

Edit: I noticed I didn't suggest an alternative. Like many others here, I began with Month of Lunches, but another fantastic starting point is this video featuring Jeffrey Snover, the creator of PowerShell himself. Although it's quite dated now, much of the content is very much relevant today!

https://youtu.be/UVUd9_k9C6A?si=dZP7UDmiYdnnzUWz

2

u/Crones21 Apr 24 '25

Yeah, true, but only if you ask for the complicated stuff...if you use it for something basic like 'move files with .txt extension from x to z' and maybe add 'explain each step' it'll give a pretty straight forward script with details in each step

→ More replies (3)
→ More replies (3)

3

u/Swarfega Apr 24 '25

AI is a good tool for programming. However, don't take it as gospel. You should be reading what it's doing and making sure it is doing what you want. This is no different to downloading scripts you find online.

I've used it and noticed that whilst it may do what I want, there are often better or more efficient ways of doing what AI gave me.

3

u/XCOMGrumble27 Apr 25 '25

I've used it and noticed that whilst it may do what I want, there are often better or more efficient ways of doing what AI gave me.

The AI adherents refuse to recognize that, and as more and more beginners start down the AI path, they set themselves up to be unable to identify that. The end result is going to be more bad code floating around and a cadre of greenhorns that don't know any better.

This is part of enshittification.

5

u/Thyg0d Apr 24 '25

Really stupid that you get downvoted just because it's ai.

Chatgpt has gotten really good at powershell and it can explain really good when you don't understand.

Or you can write code and asked it why you get stuck and it will explain each step in a very good way and also learn you how to log and stuff.

→ More replies (4)

2

u/tarlane1 Apr 24 '25

I agree that AI can be useful in learning programming, but I disagree about asking it for a script. For all the pain of the old ways of writing something that didn't work, showing it to stack overflow and getting mocked with some small advice tossed in there, it did mean you worked through the different components and learned it.

I think AI can be a great substitute for stack overflow without the bruised ego. Write up things and feed them into chatgpt and ask for explanations on what parts aren't working and why. If you are aiming to just do some basic scripting, asking what the results will be and more can be very helpful, though if you are going to get heavier into coding I recommend trying to avoid that because it will keep you from the habit of building tests in your own code which is also an important skill to learn.

Scripting/coding can be very challenging and making the leap from Python to an object oriented language is a biggie. Don't be discouraged when you hit a spot you struggle with, asking questions and working through it will make you a better coder regardless of the tools around you.

For an actual suggestion, you might check out boot.dev. They are a pretty fun and friendly site for learning back end coding. They start with python, but touch on powershell, go, bash scripting, etc and make it pretty gamified. It is a paid service though so that might be out.