Live data from Hacker News

In defense of PowerShell

benwilson.me

21–30 of 82 posts

Re: In defense of PowerShell

#21

It worse than that, the misunderstanding that is. I live and breathe Linux. But Powershell is so far ahead of bash for text and object manipulation, it's not really even a close call.

That's an interesting claim, care to back it?

P.S. *nix shell != bash, there's zsh and fish that are light years ahead re: tab completion and other general niceties.

Re: In defense of PowerShell

#22
post #15

Earlier quoted context omitted.

As a Unix person, 'Restart-Service' seems a lot easier to remember than 'systemctl'. Edit: Restart-Service is also easier to remember than /etc/init.d was. Edit 2 (rate limit): `service` on RHEL is great, but it's a Red Hat-ism. Which is fine, I used to work at Red Hat, but still. It's also pretty limited: you use service to start/stop/restart, but you still use systemctl to list services, or list /etc/init.d (techni…

It's not like 'systemctl' is the only game in town, though.

[deleted]

Re: In defense of PowerShell

#23
post #9
post #7

I work primarily in a Microsoft environment, although I have Linux shell experience as well, and I totally don't get Powershell. What is a cmdlet? Why does it need a stupid made-up name like that? Why are all the commands incredibly verbose and hard to remember? I avoid using it at every opportunity.

I find Powershell extremely weird . We have a fair number of Powershell scripts for admin tasks and frankly I think they'd all be easier to understand if they were just written in C#.

Mhmm. I wrote a set of PowerShell scripts to do some basic deployment stuff a while back and I discovered...

- Timing issues with something as simple as "remove file," where the agreed upon Stack Overflow solution was to call it "a few more times until you didn't get an error."

- Broken implementations of recursive folder copy.

- Okay, we'll call upon "rm" and "rmdir" -- oh, PowerShell intercepts those and invokes the previously described buggy routines. (Eventually figured out that I needed to shell out completely.)

In the end I regretted writing these crummy house-of-cards PowerShell scripts.

Re: In defense of PowerShell

#24
post #9
post #7

I work primarily in a Microsoft environment, although I have Linux shell experience as well, and I totally don't get Powershell. What is a cmdlet? Why does it need a stupid made-up name like that? Why are all the commands incredibly verbose and hard to remember? I avoid using it at every opportunity.

I find Powershell extremely weird . We have a fair number of Powershell scripts for admin tasks and frankly I think they'd all be easier to understand if they were just written in C#.

[deleted]

Re: In defense of PowerShell

#25
post #11

I dislike windows (and by extension, powershell) because a solution such as changing the port the webserver runs on looks something like: New-ItemProperty IIS:\sites\DemoSite -name bindings -value @{protocol="http";bindingInformation=":8081:"} http://www.iis.net/learn/manage/powershell/powershell-snap-i... What did I just modify? Is it persisted to the hard disk? How do i back that up? How do I revert the change? How…

You modified applicationHost.config which is an XML in %windir%\system32\inetsrv.

IIS has its' own set of commands that you may be more comfortable with, appcmd is sorta like apachectl (just more verbose). http://www.iis.net/learn/get-started/getting-started-with-ii....

Re: In defense of PowerShell

#26

> I’m willing to admit that PowerShell isn’t obviously better as a shell than something like bash, but it’s unquestionably a better language to use for scripting. There's a missing "on Windows" here. Sure, PowerShell is clearly a tool designed for the Windows environment. And if you're a Windows system administrator, it has more tools and glue for that environment. You could use PowerShell to replace things that you'…

Bash has notorious gotchas, and similarly, doesn't work well natively on Windows without a whole slew of associated applets.

Sounds like both shells have one of those problems... ;)

Re: In defense of PowerShell

#28
post #21

It worse than that, the misunderstanding that is. I live and breathe Linux. But Powershell is so far ahead of bash for text and object manipulation, it's not really even a close call.

That's an interesting claim, care to back it? P.S. *nix shell != bash, there's zsh and fish that are light years ahead re: tab completion and other general niceties.

And yet scripts for them are still written in a bash-like language for backwards compatibility reasons, which is really a shame in my opinion, because it is not a particularly convenient family of languages.

Re: In defense of PowerShell

#29
post #15

Earlier quoted context omitted.

As a Unix person, 'Restart-Service' seems a lot easier to remember than 'systemctl'. Edit: Restart-Service is also easier to remember than /etc/init.d was. Edit 2 (rate limit): `service` on RHEL is great, but it's a Red Hat-ism. Which is fine, I used to work at Red Hat, but still. It's also pretty limited: you use service to start/stop/restart, but you still use systemctl to list services, or list /etc/init.d (techni…

It's not like 'systemctl' is the only game in town, though.

You say that as if that makes remembering things easier.

Re: In defense of PowerShell

#30

Noone gets Powershell.

Some of us do, but we've given up trying to expose HN to the shell. The anti-Microsoft culture that built up in the late 1990s and early 2000s has too much inertia on HN to overcome by occasional articles.

Keep in mind that much of what seemingly makes Powershell so great on Windows is inapplicable in a Unix shell environment. So there's still some juvenile "M$ hyuck hycuk" nonsense, but there's also some pretty spot-on discussion of the difficulty of trying to move tools between very different systems.
Post reply on HN