r/Python • • Sep 17 '20

Resource PowerShell vs Python Reference

https://blog.ironmansoftware.com/powershell-vs-python/
88 Upvotes

25 comments sorted by

View all comments

7

u/its_a_gibibyte Sep 17 '20

For people that know Python (or perl or bash or whatever), what's the point of learning Powershell? It seems pretty limited since it's primarily for windows machines (and most servers are linux) and doesn't have the libraries that Python has.

6

u/Eitan1112 Sep 17 '20

I worked with both, and some things are better to do with powershell. For example:

  • Simple scripts to automate management of remote windows computers

  • Great modules for AD and office365 management

  • Built in Wiindows, so distribution is less of a problem (of course you can compile python to an executable, but it is much easier if you already know powershell

Of course python has some counters for that, like the WMI library, but it feels much more natrual to do such things in powershell.

1

u/[deleted] Sep 17 '20

Do you have some examples of python modules for AD? I'm looking to replace powershell with python, but the only way I saw to get at AD was basically formatting custom ldap requests, which imo isn't better than powershell. I'm basically looking for a drop in replacement for functions like get-aduser, get-adcomputer, etc.

1

u/cerebron Sep 18 '20

I'd also love this. I manage mostly windows machines with AD so I do a lot of Powershell stuff, but everything I do at home is Python. All the Python kerberos and ldap libraries are kind of a pain compared to the ease of Powershell.