[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
What is /g/'s thoughts on powershell?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 15
Thread images: 3
File: 42-powershell[1].png (4 KB, 128x128) Image search: [Google]
42-powershell[1].png
4 KB, 128x128
What is /g/'s thoughts on powershell?
>>
5/5 breddy gud. I do wish there were something like tmux, though.
>>
Oh, this is relevant to my interests.

What are some good resources for learning it? I've got bash/sh pretty much nailed down but Powershell syntax feels totally foreign to me now.
>>
File: check em.gif (55 KB, 465x293) Image search: [Google]
check em.gif
55 KB, 465x293
>>51238999
the official MSDN docs are great tbℏ fɑm
>>
>>51239038
>tbれ
You're a bloody genuis! Thanks
>>
>>51238912
I use it daily as part of my job.

Functionality-wise, it's really good. You have access to the full .NET libraries (which offer you a ton of functionality already) + some nice additions for Powershell only.
Without going into details, let's say that for Windows sysadmins, it's golden.

It also makes good use of piping, and really simplifies "foreach" in pipe structures.
You also have nice handling of multi-properties objects, which make it really easy to work with them and display them.
It also has a bit of functionnal programming in it.

Syntax can be a bit quirky (param block for arguments, -and -or, , obj | % { $_.prop = value}, ... ) however, but way better than BATCH or VBS, and more reliable than Bash on Linux (no weird spacing issues, ...)
Also naming convention is unusual, but this just need some getting use to.
MSDN doc is pretty good, and I recomment you work with your script using an IDE, the one provided included by default with powershell is good enough (Powershell ISE). It will give you autocompletion,help, ...


Overall it's quite good, and it replaced VBS has the default go-to when working with Windows system.

For big projects, it's no replacement to a good old Win C++ project, or a C# project. Powershell is good for small scripts, not big projects, but that's the case for pretty much any scripting language.

Also, if you don't plan to use Powershell for system administration, or don't plan to deal with the system (like only echoing to console, writing / reading from files, ...), I don't really recommend it, although it can be used for that. It'll be easier to use some other language like Python, Perl, ...
You'll have more ressources, and overall a bigger community.
>>
>>51239536
>Also, if you don't plan to use Powershell for system administration, or don't plan to deal with the system (like only echoing to console, writing / reading from files, ...), I don't really recommend it, although it can be used for that. It'll be easier to use some other language like Python, Perl, ...
Easier perhaps, but installing Python/Perl/Ruby on Windows also expands the attack surface considerably. PowerShell, on the other hand, ships with all versions of Windows.
>>
>>51238912
Snowver is a pretty cool guy, eh tells autists to fuck off with their ebin recursive memes and replaces them with Object-Action commands and doesn't affraid of anything.
>>
Powershell is goddamned amazing.

THOSE MAN PAGES.

THOSE GLORIOUS, BEAUTIFUL, 10/10 MAN PAGES.

>>51238999

Powershell in a Month of Lunches is a pretty solid read.
>>
>>51239536
>more reliable than Bash on Linux (no weird spacing issues, ...)

Counter-opinion:

I am a UNIX sysadmin. Mostly RHEL and BSD, nowadays. With a few years' experience and by following some simple rules, a shell script is far more reliable and portable. (If you're using bashisms, you're doing it very wrong indeed.) I have shell scripts I wrote over a decade ago that are running today on completely different OSes.

Over the last five years or so, I've helped manage a couple dozen Windows servers, mostly for quick one-off tasks. Not really my responsibility or area of expertise, just helping out. My exposure to PS thusfar has been terrible, but I can't honestly say I had any interest to begin with, so I know I'm biased.

It comes down to one thing: Every time I find myself attempting to follow even official Microsoft documentation, the commands don't work. They either don't exist in the versions of whatever we're running or the arguments/options are different. I am not exaggerating. Every time.

Maybe that says more about our Windows sysadmins than PS. Maybe I have a fundamental misunderstanding somewhere. Dunno. Don't really care. Just my experience.
>>
>>51238912
i use it at work all the time
>cons: version compatibility issues
>>
>>51241081
win 7 comes with ps 2 which is old. Either browse the docs by version or install wmf to get the last one.
>>
I love it.

The fact it's object based rather than file based is what I like about it. I try use ipython as system shell whenever on a Linux box but it's not quite all there.

Get-Help are a god send for anyone whose had the misfortune of being stuck in a room with Linux manpages even once in their life.

PowerShell ISE is bretty gud too.

It can be a bit verbose but plenty of aliases for general use that are fairly interchangeable with what you'd use on a NIX machine.

You have the power of .NET behind it but imo that is a main selling point for server admin with windows software/services.
>>
>>51238912
Not bad but it doesn't let you escape from all the windows legacy shit.
>>
File: 1343005719168.png (140 KB, 595x713) Image search: [Google]
1343005719168.png
140 KB, 595x713
>>51239574
The vast majority of my time as a sysadmin has been on *nix. However, I have had to deal with dualboot classroom labs. I had to be really stingy with disk space as the image post-sysprep was close to the capacity of the harddrives on the shittiest boxes. On the occasion or two where I've had to use powershell, I've found the docs decent enough to cludge out a simple script. There are situations where you need to use the first class citizens. Powershell is not a bad tool; it's just that I hate dealing with windows.
Thread replies: 15
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.