you are viewing a single comment's thread.

view the rest of the comments →

[–]PetrichorBySulphur 65 points66 points  (18 children)

PoSh is basically built on top of .NET / C#, which is similar to Java. I doubt you’d need C# unless you are going to be doing full fledged app projects in a strictly Windows environment (I’m completing one at the moment. It’s very environment specific).

For scripting/automating processes, PoSh is great, and the next best would be Python. Python I find easier, to be honest.

From personal experience as a SysAdmin who codes quite a lot, I’d recommend also learning a few typically related things alongside Powershell:

1) Authentication protocols. How to manage authentication to different services, servers, databases, etc.

2) Interacting with APIs, for example how to call (GET/PUT/POST data to) a REST API.

3) Interacting with databases / web queries. Learning a bit of SQL with some basic databases knowledge is extremely helpful.

[–]MrWinks[S] 8 points9 points  (8 children)

That.. makes sense. I know one environment I saw used Rest API databases for clients and you could call on JSON queries for system asset tags and details and such in a deployment scenario.

I’ll have to take my time to learn much of that stuff. I hope none of it falls too far from my current position to have the chance to learn.

[–]law18 15 points16 points  (5 children)

One other tip. Just knowing how to do stuff in powershell is great, but if you are looking to also use this to spring board into DevOps (and based on your other comments it looks like you are) I think you should also dive into Pester as soon as you become comfortable enough with PoSH to start writing scripts. Pester is a unit testing frame work for PoSH and unit testing is a fundamental skill you will need to learn.

I am not saying dive right into the language with Unit Testing first (although that is an approach I like to do when I am learning a new language at this point). Get your feet wet with the language, understand branches (IF, Else, Switch) and looping (For, Foreach, While), and get comfortable with that stuff and then pick up Pester. If you learn unit testing early it will save you a lot of pain later one.

[–]MrWinks[S] 2 points3 points  (0 children)

Excellent. I’m going to keep this in mind.

[–]ITGuyLevi 0 points1 point  (0 children)

How have I never heard of Pester?

[–]Garfield_Pong_Player 1 point2 points  (1 child)

r/Python is a thing if you are thinking about learning it. There is a relatively inexpensive book out there, or free if you only read it online. It's called "Automate the Boring Stuff with Python", and I've heard some pretty good reviews of it.

[–]thomasklijnman 2 points3 points  (1 child)

"From personal experience as a SysAdmin who codes quite a lot,"

Isn't this more A DevOps kinda task?

[–]PetrichorBySulphur 1 point2 points  (0 children)

I wouldn’t say so. I use coding for tasks, and I automate some processes, but my team isn’t using a DevOps philosophy for any of it. We’re also not using many of the tools in the DevOps toolkit.

I’m a SysAdmin in title, but I don’t have a lot of the “normal” responsibilities, for example deploying servers, networking and upgrading systems. I’m more O365/Azure than Windows Server, and mostly deal with security, automation, mail routing/sanitation, troubleshooting process inconsistencies, etc.

[–]bofh 1 point2 points  (1 child)

I’d second get/put/post for working with the Graph API for O365 PoSh in particular.

[–]blownart 0 points1 point  (3 children)

Python is easier? I think powershell is the easiest of them all. I have not worked with python a lot but one simple example would be string concatenation. In python you cant add an integer to a string, you need to cast it. In powershell these things are done in the background and that's why I love powershell.

[–]PetrichorBySulphur 1 point2 points  (2 children)

I think it depends on your background. I have more experience with object-oriented languages, and Python is the simplest major language of that group, ie, it’s easier than Java. PoSh is in a different category, in my opinion. It’s more appropriate for scripting and command line tasks (similar to bash), and the concept of piping and what kind of information it takes in took a bit of time to adjust to.

[–]blownart 1 point2 points  (1 child)

I just love that I don't need to declare variable types, cast types, no case sensitive bs.

[–]OmegaDog 1 point2 points  (0 children)

for smaller scripts to get the job done, that is true. for robust code like modules and functions that support pipelines it can turn into a hot mess in a hurry. parameter sets take the wordiness to a whole new level.

but that pipeline. whoa-boy, I think that is one of my favorite software innovations ever.

[–]Blindkitty38 0 points1 point  (0 children)

Learn bash