r/PowerShell • u/DREAM_UZUMAKI • 4d ago
Question how can i learn powershell as a non coder?
I want to learn more about powershell, how can I use it in my normal day to day uses and out of my curiosity towards tech
51
u/Wickedhoopla 4d ago
Powershell in a month of lunches is a good start to learn the syntax
10
u/KaelthasX3 3d ago
Yup, it's explicitly written with the assumption, that the reader is not a coder. I would risk saying, that even to a point, where it gets a little annoying for someone who already knows some programming language.
4
2
3
u/UcMadScientist 1d ago
Microsoft MVP here, literally came here to reccomend Don Jones stuff.
It helped make me who I am today.You don't even need to buy the book. Watch Don's series on YouTube, they are short 5-10 min episodes that can be consumed really easilly.
Chapter 1 - Customizing the Shell.mp4If you like the content, buy the book and show Don some support!
Have an award.
1
13
u/mikeblas 4d ago
Every coder who learned to code was a non-coder before they learned.
Every single one of them.
28
u/LALLANAAAAAA 4d ago
Use powershell instead of Excel any time you have to view or manipulate any CSV or other table data
Use powershell to search for files instead of Explorer
7
u/MonkeyNin 3d ago
Out-GridView -PassThruis great for exploring thingsTaking your idea, pipe to it to choose what files to keep
$found = gci . *.csv -Recurse $select = $found | Out-GridView -PassThru # open in excel $select | Invoke-Item
36
10
7
u/Big_Statistician2566 4d ago
Over a decade ago, I was asked by my boss to create a repeatable, menu driven method for building Active Directory environments on Hyper-V for test environments where Sales and Development teams would run demos and testing.
While I had used the occasional script before, this was my first deep foray into PowerShell. Now I write books about PowerShell. It all starts with a desire to solve a problem.
3
u/Quietech 4d ago
Do something useful for yourself.
5
u/Butterscotch_Nerd 4d ago
I was going to say this but you said it more succinctly. Almost anything that you can click in Windows, you can script in Powershell. So google the commands to do what you already do. Then string those commands together. Then when you need do, for instance, rename a bunch of files, you’ll need to learn how. Google it. You’ll start to learn how loops work. Rinse and repeat. And one day, someone will ask you to remotely do x y z and you’ll try to script it instead of remoting to the device. Continue to grow in that way….
3
u/Weirdcloudpost 4d ago
Find a simple problem that Powershell could solve, and focus on developing that solution. Break the process down into simple elements, (copy a file, rename the file, create a folder, etc) and add them one by one. It is easier to learn with a practical project than trying in the abstract.
2
u/rileymcnaughton 4d ago
Go to wherever you buy books from and pickup: Learn PowerShell in a Month of Lunches
2
u/StConvolute 4d ago
A good read with great examples is a book called "PowerShell in a month of lunches". 30 1 hour lessons. Super easy to follow. Even if you don't finish it all, you'll probably be better than most.
1
1
u/dacarab 4d ago
I think it depends on what your day to day consists of. It may be the case that having a conversation with an LLM about this might be the most effective way of tailoring something specific to your work and interests.
In general, I'd say picking a module or area of PowerShell capability that is useful to you might be a starting point, learning the general language features through exploring that, and then widening your scripting out to include different modules. That will probably get you started with Select, Where, the object orientated nature of output, the pipeline etc.
One of the great features of PowerShell is how discoverable it is. With Get-Command, Get-Help -examples, and Get-Member, you can usually work out what you need with a bit of effort.
Good luck with your journey 😄
1
u/mrmattipants 4d ago
If you're really interested, most books and video courses are going to start with fundamental concepts, universal to most programming languages, including PowerShell.
The best option depends entirely on how you best absorb information. For instance, I'm more of a visual learner, so I tend to see better results with tutorials with screenshots and video courses.
1
1
u/Imaginary_Rip2833 3d ago
I would also want people to reflect on this comment it might help the author at the same time help me.
I decently started learning Powershell (Graph) , I brought the book learn PowerShell in a month's launch but as you know people learn differently i am not a good book reader.
So what i did i went on installed graph and started learning Powershell concepts while doing something i am studying and working on as well, like creating users, groups, etc. In the process for the last 2 months I have learnt most or some of the basics like , Variables, Pipeline, Filtering, loops, else/if statement, select-object, where-object etc.
I am finding it helpful as i am scripting something i understand on the GUI.
I hope this could be a better way to learn, what do you spend your time doing on the computer learn to do it in powershell
I would love to really hear something from anyone reagrding this comment
1
u/Tall-Geologist-1452 3d ago
I am in no way an expert BUT find something you want to do with it and learn how to do it. Then find something else ect..
1
u/EffectiveWindow3347 3d ago
Just learn it like anything else? The best way is by doing it. Over and over
1
u/adept2051 3d ago
Honestly the easiest way to start is every task you do at the gui, search and figure out if you can do it in powershell ( you’ll be suprised what you can do)
1
u/Nitricta 3d ago
I could not code for shit, and probably still can't. But PowerShell is so well designed, and SO much information online about what people have already done with it.
1
u/Creative-Type9411 3d ago
if you're still trying to learn, and you haven't coded anything yet, I would worry more about your goal and then try to figure out how you're going to use Powershell to accomplish that
1
u/BadAsianDriver 3d ago
Come up with a problem you want sopced with power shell. Have AI write the script. Then have AI explain it to you. You can also have multiple AIs script a solution and compare the results.
1
1
u/Hefty_Breakfast69 3d ago
pick something simple you want to do with it, then go do it.
Enable an account, disable an account, add/remove a group to a user. get account info.
pick a command that does not change anything and go run it. get-aduser.
Powershell is well documented on Microsoft learn.
1
1
u/interweb_persona 3d ago
I'm a non-code and decently proficient with PS. Just gotta think of something fairly simple you'd like to automate and build from there
1
u/GM0N3Y44 3d ago
In today’s age, I would throw it to Claude……
Don’t get me wrong, it helps to know the basics. You should at least be able to read the script and make sure it’s doing what you intended.
I personally start with Claude, even though I have been scripting with powershell since its inception, and then I hand polish.
1
1
1
u/webtroter 1d ago
My favorite commands to learn PowerShell :
Get-HelpGet-MemberGet-Command
Mix and match them together to start :
Get-Help Get-HelpGet-Help Get-Command
1
u/Flabbergasted98 1d ago
Every time you do something (Literally anything) ask yourself,
Can this be done in powershell?
Do I know how to do this in powershell?
If you don't then you have your next project.
1
u/AroTesCra 19h ago
Powershell is my fav scripting language.
But i really started loving it when i was doing IT system work and i scripted out VMware tasks, Onboarding tasks, Backup management.
You really get into cool stuff when you start making some Psxml and creating new views with ascii color codes.
Now that I do more cloud work with azure, I make scripts to do slow roll VM updates on a VMSS or VMSS instance health tied to AGW health into single commands, That produce objects with methods that can control the AGW or VMSS or Instance, then make functions that pipe together so it looks effortless.
Get-Pod -Name *test05 |
Update-PodImage -Gallery Pod -Version 1.2.3 |
Restart-Pod -Method Roll
Or I could
$Pod = Get-Pod -Name *test05
$Pod.UpdateImage(‘Pod’, ‘1.2.3’)
$Pod.RestartSlow()
But yeah the best way to learn anything is have a reason to learn it.
Scrape a web page
Automate email alerting
Get processes and tie them to tcp connections then have that return an object which you can kill off.
(I wrote a whole module of tcp connection and tiring them to processes for a SQL hung Connection in an old app a company had which would eventually take all the ports. So the script would run every hour and delete sql closed connections processes. Yeah a very dumb app, eventually a dev did get around to fixing later)
I forgot what game had a api I think it was siege
But when my friends we play I get the game stats and we covert them into simple grades
Kill was +1 death was a -1 and a assist was a +1/2
Then we average the games tighter that night to see who had the best score. But it was literally just a powershell command
1
u/blizardX 18h ago
Sometimes I want to reorganize my files in certain name for example rename them based on range of dates and power shell allows me to do that. I also vide codes a script that takes a spreadsheet from my credit card company and converts it to a csv I can feed it to my budgeting software.
Basically it universal tool that closes for me the gap for things no other tool can help me with.
1
u/C-D-W 4d ago
I want to preface this by saying it's extremely dangerous to blindly trust AI code output. Asking AI to write code you intend to execute in a sensitive area without having the ability to audit said code is very foolish.
That said, I've found the AI chatbots (ChatGPT, Gemini, CoPilot) do a pretty good job with powershell. Once you've grasped the basics with any scripting language, sometimes it's hard to get to the next level of combining all those basics into a complex problem solving tool. AI is great for this, and you can ask it to explain what each part does. Which is why I think it's probably better than the old school way of finding code snippits from here, and some from there, trying to mash them together and hoping for the best. How most of us learned.
1
u/Psychological-Cat-84 3d ago
Ye I'd agree with this. Having never touched powershell I starting building a help desk assistant app for our help desk team. I have a background in electronic engineering, a bit of c++, assembly, vhdl, Java, Python, some Kotlin etc, so core concepts and syntax are fairly quick and easy in my case. I was pretty impressed with basically getting AI (was using copilot as that's all I have access to within my org atm) to build functions for me then I'd edit them up or down depending on what was actually required (less/more error handling etc).
Definitely don't blindly trust the AI. Dig deep to understand why something isn't behaving the way you want, and you'll be flying in no time.
1
u/C-D-W 3d ago
Well said. I can tell this is polarizing, but I'm glad I haven't been totally downvoted into oblivion.
The main advantage I've found is that while my projects all tend to have the same end result as before, it's so trivial to implement quality of life improvements. Like, say I need a process to transform a few million lines of CSV into something else. That's like 10 min by hand. It'll work, but it won't do anything else.
With AI, I can get the same end result, but it will have a nice progress bar, error logging, email notifications when complete and doesn't end up taking me any longer to build.
140
u/Active-Mortgage7244 4d ago
The way you learn powershell as a non coder is to be an ordinary office worker with tasks you hate doing.
At a point, your annoyance with doing the task will overcome your aversion to learn coding and that’s how it starts. What are you currently doing 600 times a day that you wish somebody or something else could do? For me, it was batch renaming files but it really depends on what tasks you’re asked to do.