r/PowerShell • u/Defiant_Wafer5282 • Apr 04 '26
Powershell Noob
Hey all
I’m a slight newbie and landed a JR infrastructure engineer role that includes looking after cloud environments, patching software and machines.
Is there any advice where I could get into learning more powershell scripting or and decent YouTube courses I could follow
Any help is appreciated
20
Upvotes
View all comments
Show parent comment
0
u/TofuBug40 Apr 05 '26
Take this, an example of one of the many composable actions that can be called in script or setup in the TS GUI editor.
This actions ENTIRE purpose it to robocopy from source to destination that's it and once again the code itself tells you exactly what it does.
It might need to map a drive to either with some kind of credentials but it doesn't handle that it just makes a call to another Action that DOES do just that Map a Drive.
The Map Drive Action itself hands off the Token to a Func whose entire job is to inline return a fully formed
PSCredentialobject that map drive just uses as it sees fit.All the way down every component is as pure as possible. Nothing shoulders more than one responsibility.
With something like this I can both compose in code as well as completely in the GUI for TS editing (with no coding knowledge needed) for my operations guys that don't have the time or desire to learn PowerShell just about ANY complex automation process you can imagine. And in the rare cases we run up on something we don't have I or my team make a new Action, Predicate, or Func to do, test, or return ONE specific thing or task.
From the outside it looks complicated for good reason 30,000 systems at any one time running a mirade of processes all leaning on some or all of that infrastructure just humming along ignorant to the engine underneath. But you zoom in on ANY component and its literally simplicity all the way down. Every one is understandable just by looking at the code.
I will concede since I don't think about it as much but I have logging for obvious reasons and that is one place I would say if you HAVE to write comments kill two birds with one stone and do a logging write.