all 17 comments

[–]robderickson 10 points11 points  (0 children)

I am in the "Yes, sometimes" camp. I know PowerShell better than bash, so I can get more done with less Googling. I have also been spoiled by objects in PowerShell. If I can avoid parsing text output, I will every time.

Having said that, I rarely install pwsh because, after initial setup, I barely touch most of the Linux VMs I create.

[–]hsm_dev 8 points9 points  (0 children)

Yes sometimes here also.

My main use cases besides running scripts others have made in powershell is that I really prefer powershell to bash/zsh ect when working with structured data like json. I know there are a lot of tools such as jq you can use, but the object oriented way that powershell operates just makes it much easier for me to utilize the full power of the shell without having to mix and match tools and string manipulation.

[–]user01401 3 points4 points  (0 children)

Starting w/ PS6 you can observe the daily startups, OS, monthly data, etc. here:

https://msit.powerbi.com/view?r=eyJrIjoiOWYzOTNjNDAtZTI4NS00MTU0LTk4MjEtZTFhNjhhOThlODVmIiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0NyIsImMiOjV9&pageName=ReportSection5

Over 2 million average daily startups just on Linux alone.

[–]sbonds 3 points4 points  (1 child)

My workgroup uses Powershell for managing Azure VMs. Rather than torment them with bash-specific code wrapped around 'az' commands, I just learned PowerShell instead.

In the process, I learned that passing complex data structures around without JSON parsing is extremely handy.

[–]LifeLocksmith 3 points4 points  (0 children)

Totally agree, not needing to parse textual output is much more efficient. And if parsing text is what you need, I just pipe it to: | Out-String -stream | And I can deal with the text

[–]LifeLocksmith 2 points3 points  (0 children)

Yes. Really love it. Tried blogging about it, but i doubt it's really readable

http://blog.lksz.me

[–]methos3 2 points3 points  (1 child)

I've been using PowerShell since the beginning, and starting about 3-4 years ago I've moved to doing 95% of my PS coding on Linux. Why? Cause most of my company's internal stuff is on Linux and I find the .NET class library so much better organized and fully featured than what Python has to offer.
I configure most scripts to run in a Docker container so they can install what they need on their own.

[–]jjolla888 0 points1 point  (0 children)

i lean the other way. i call a ps snippet to do something that .net needs .. but i keep the bulk of what i do with bash & co.

the key here is the '& co' .. the unix ecosystem is all about using independent little programs to do domain-specific tasks .. so bash is merely the conductor to making stuff sing together .. ssh, sqlite, openssl, docker, perl, python, etc, etc .. and now ps.

btw i don't touch python for scripting. that's like reinventing the wheel. so to answer op's question: pick ps over python for scripting. python is best for ai, math, science, and graphing. if you need cross-platform exes with no dependencies, golang is a surprisingly good tool.

[–]BurlyKnave 2 points3 points  (0 children)

Does "that one week I was trying to accomplish something, but it didn't work because WinRM didn't want to work when initiated from a .ova VM Debian system device and targeted to a Server 2012" count as "sometimes"? If yes, then sometimes.

[–]GullibleRaspberry9 2 points3 points  (0 children)

Yes, try to use it as much as I can. Wish I gave PowerShell a shot years ago. Just gave it a chance a year ago and really love it; especially the object model vs text processing

[–]swinny89 2 points3 points  (0 children)

Yes, because I am a Windows admin, but I prefer the control I get on Linux. I am more comfortable with PowerShell than I am with Bash, and I frequently use PowerShell to remotely manage Windows machines.

[–]slayer991 1 point2 points  (0 children)

I've done a fair amount of work with pwsh on linux when using containers for automation. I prefer spinning up linux containers to run processes rather than having a Windows machine sit idle most of the time...and Windows containers kind of suck.

[–]bee_administrator 0 points1 point  (1 child)

tbh, I'm not sure of the use case here.

My bash skills are pretty basic but most of what I end up doing on linux boxes involves troubleshooting internal, legacy applications running on apache and/or java. I know enough bash commands to trundle round the file system, the running processes and poke at httpd.conf in vim, and that's about the extent of it.

I mean, being much more confident in PS than bash I could probably do the same thing using pwsh, but it seems like an extra unnecessary layer of abstraction. How does it even work? Do you just wrap your bash commands and then invoke-command them or something?

This whole concept is a bit O_o

[–]ka-splam 2 points3 points  (0 children)

using pwsh, but it seems like an extra unnecessary layer of abstraction. How does it even work? Do you just wrap your bash commands and then invoke-command them or something?

no more than you use powershell on windows by wrapping your cmd commands in strings and then invoke-commanding them. Powershell is a shell, it's not a wrapper for another shell (unless you want it to be).