r/PowerShell • u/wrtbwtrfasdf • Nov 07 '19
Powershell top ten for growth in Github usage(154%); beating out Python and Go in growth(%) from 2018-2019.
https://octoverse.github.com/#top-languages2
u/pertymoose Nov 08 '19
Why compare Powershell and Python usage in the first place? Sure they have overlap, but they're intended for wildly different purposes are they not?
On Windows you basically have no alternatives to choose from, and on Linux I'd be much more interested in seeing whether or not Powershell is managing to displace Bash (and co.)
If you want to compare Python, compare it with C# which is a much more worthy competitor.
2
u/wrtbwtrfasdf Nov 08 '19
The comparison was made because Python and Go are well known and have had insane growth in usage over the last couple of years. Didn't intend to indicate that their use cases were the same or that they were competing directly (though in some cases that might be true).
17
u/dwivedin Nov 07 '19
I have been using a lot of PowerShell to do database stuff and dbatools is a bliss for dba’s who have to manage a lot of sql servers.
3
20
u/uptimefordays Nov 07 '19
I've rewritten a lot of Python scripts in PowerShell, and frankly didn't expect that to happen!
5
u/bennyboo9 Nov 08 '19
Just out of curiosity, why?
12
u/DesertGoldfish Nov 08 '19
Can't speak for OP but for me our images at work don't have python on them... But everyone has powershell!
0
Nov 08 '19
[deleted]
15
u/xbullet Nov 08 '19
He wrote Python scripts that he had to ship python as a dependency to run, and later realized that this overhead isn't worth it when PowerShell is more than capable.
-1
u/lexd88 Nov 08 '19
I usually just compile my Python scripts to binary and works cross platform with this docker container
https://github.com/cdrx/docker-pyinstaller
I find PowerShell very frustrating with different versions of Windows running different PowerShell versions, e.g. PSv4 and PSv5, some modules are missing etc.. and just breaks..
3
u/InNomine Nov 08 '19
Don't you have the same issue with python if you don't use a container.
1
u/lexd88 Nov 08 '19
I interpret the OP as saying the dependencies are missing with python so he used PowerShell instead. Also every machine needs python installed which is a pain and not many businesses install python to their SOE
if you compile your code into a binary, all the libraries are stored within the single executable file. which makes shipping very simple and can be run cross platform (windows and Linux). This is another reason why portable apps are .exe and not the source code itself unless you want to compile it yourself.
you only want to use containers is when you are collaborating with another person who is editing the same piece of code and require the same libraries. In the development and DevOps world this is a common problem and this is why containers are so popular amongst developers.
1
1
Nov 08 '19
You can update Powershell. Anything after Windows 7 and Server 2008R2 can be updated to PowerShell 5.1, IIRC.
0
u/anynonus Nov 08 '19
>>> print 'boo powershell for having different version'
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('boo powershell for having different version')
1
u/lexd88 Nov 08 '19 edited Nov 08 '19
from future import print_function
print ('whats the equivalent to make PowerShell compatible?')
also not referring to syntaxes here but there's missing PS modules across versions.
Compiling code is always better for distribution. Compiling is not hard when running through a CI/CD pipelines on tools like Jenkins when new commit is pushed to Git. New binary gets saved to a shared storage and users will just go there to get the latest version.
6
u/DesertGoldfish Nov 08 '19 edited Nov 08 '19
No, obviously, that would be silly.
I work in a very diverse environment. Not everyone works from the same image. Some of us have Python, some of us don't. Some of us have Photoshop, some of us don't. You know what everyone has? Powershell. We have professional educators, IT guys, CS guys, artists, and bean counters all in the same room.
For example, I've re-written (I didn't write the original) some scripts as quality of life improvements for less-savvy coworkers who would normally have to SSH to a CentOS server to run a Python script. Rather than open PuTTY and do that they'll click through 10 different intranet web pages to get information.
A lot of people (coworkers, am I right?) will just ask you to do the thing for them, or do it in a really inefficient way instead of going through the hassle of submitting a ticket to get an admin to install Python on their VM and learn what the hell Python is. Now they can literally just click the ps1 instead.
That, and "new" things that I've observed would save a lot of time or tedium, that would normally have been written in Python before I was hired, if they were even written at all, have been written in Powershell instead.
TLDR: Powershell isn't doing anything Python can't, but I get to improve my coworkers days by doing something I find enjoyable, and is ultimately better for the company.
2
u/anynonus Nov 08 '19
Clicking the ps1 script to run it isn't default functionality How do uou configure that? (I still let them start batch files which calls a powershell environment)
1
u/poshftw Nov 09 '19
Powershell isn't doing anything Python can't
Nah, PS doesn't bitch at you at type conversions THAT MUCH.
/s, obviously
2
u/uptimefordays Nov 08 '19
PowerShell has gotten a lot better over the past couple years. It used to be kind of a pain to automate anything running Windows now it's frankly easier to just use PowerShell and lean on .NET or C# when the going gets rough.
6
u/sponge-robert2 Nov 07 '19
Powershell is my fav. I'm a storage guy (EMC), use it to automate all kinds of things since jump servers are windows. I've been an automate guy for years. Best I've worked with is powershell.
2
u/_ralph_ Nov 07 '19
Never worked with EMC, my former company was a NetApp shop but PowerShell ist used there also.
2
u/anynonus Nov 08 '19
Got some tips on powershell modules for netapp (we had one installed this week)?
2
u/_ralph_ Nov 08 '19
Mostly my tip is to not use WFA as an IDE for your scripts but build and debug them in ISE or whatever you normally use for powershell.
I hope this tip is very dated already :)
I have not used NetApp and our toolchain in over a year, so please forgive me for not being able to give you more tips. But you will find a few interesting people to talk to in /r/netapp/
1
u/lexd88 Nov 08 '19
I'm curious how PowerShell works with EMC storage? are you running stuff via RestAPI? I would imagine people would be doing SSH and some bash scripts for storage automation?
1
u/sponge-robert2 Nov 08 '19
Hello, not using REST but that is something I've been meaning to spend time on. What I most love about REST for VMAX is you can get perf data through it. I just use a jump server with solutions enabler. I have VMware team make some rvtools CSV files available via url. I can then cross reference all storage to datastores and RDMs via a script. That's just one example, I use it also for automation of command creation and if wanted to run commands also.
5
u/mcc85sdp Nov 08 '19
I mean when "Power" is your first name, it's only natural that it will kick the shit out of anything else out there that doesn't have "Power" for it's first name... Obviously...
But also because it is also incredibly badass. And cool. And fun when you know how to use it. And powerful. And doesn't suck. And isn't lame. And, does everything. <- all of that. Is the real reason why. It's also because when you need to go full out Teenage Mutant Ninja Turtles mode, pst... You get heroes in a half shell. Turtle Power.
I'm fairly certain that Microsoft thought of TMNT when they called it PowerShell. I'd be willing to bet a 2070 then year dollar on it. For sure.
2
Nov 07 '19 edited Aug 20 '25
skirt rich middle seed placid meeting live fearless rock hungry
This post was mass deleted and anonymized with Redact
1
u/sponge-robert2 Nov 08 '19
Yeah the way I see it, anything that has command line is a great fit for powershell.
1
1
Nov 08 '19
[removed] — view removed comment
1
u/AutoModerator Nov 08 '19
Sorry, your submission has been automatically removed.
Accounts must be at least 1 day old, which prevents the sub from filling up with bot spam.
Try posting again tomorrow or message the mods to approve your post.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
6
u/wrtbwtrfasdf Nov 07 '19
I'm not a PowerShell guy so I'm wondering if you guys can explain this growth?
It had seemed to me that Microsoft had largely given up on Powershell. I know they released the cross-platform PowerShell, but most Azure docs are still written in Bash. Often, they give PowerShell equivalents as well, but often the PowerShell directions are outdated or incomplete.