News for hackers. Stuff that matters.
Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by wvenable on Monday January 22, 2018 @01:12PM (#16206497)
My biggest complaint with PowerShell is that it's unnecessarily inscrutable -- filled with Bash-like and Perl-like syntax and semantics without the legacy to justify it. I wish writing in PowerShell was as easy as writing C# but instead it's almost as bad as writing Bash scripts.

It's not good for programming or scripting. There are so many good ideas in PowerShell but it's wrapped in a weird body.

Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by darksim905 on Monday January 22, 2018 @02:12PM (#16207011)
As a Syasdmin, Powershell is a scripting dream: it has tab completion for the commands and the switches. I don't feel like I have to guess or look at man pages to figure out why there's a -s and an -S. The help pages are usually written for human consumption by comparison. Saying that it is 'unnecessarily inscrutable' is quite hilarious - have you seen some Linux commands & the lack of output they give? Powershell, if anything, ins extremely verbose & is clear in when something goes wrong.

At least, it doesn't insult you like Ansible tooling with the ^ YOU MADE A MISTAKE HERE BUT WE CAN'T BE CLEAR WHAT IT IS

Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by wvenable on Monday January 22, 2018 @04:30PM (#16208096)
You're comparing PowerShell to Bash -- I'm comparing it to any language written in the last 20 years.
Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by figgis on Monday January 22, 2018 @03:16PM (#16207520)
Well bash has (can have) all of that as well.. Those are features of the code editor.. Not the language.
Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by hoppelhase on Tuesday January 23, 2018 @04:27AM (#16212138)
I think it's a good thing to have in the language to specify which switches require some options and which exclude some other ones.
Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by erk__ on Monday January 22, 2018 @03:50PM (#16207793)
It is a bit differnt because windows is bundled with Windows PowerShell ISE which is the IDE I think he is talking about.
Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by mattmanser on Monday January 22, 2018 @02:26PM (#16207119)
We have all of that in C# without the rediculously bad syntax.

It's such a shame powershell didn't come 2 years later, I feel like they'd have had no choice but to use C# instead of inventing a new language.

Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by JeffreySnover on Monday January 22, 2018 @05:04PM (#16208395)
We thought about that but the reality is that it does not work well for interactive experiences.

When you look at how admins get their job done, it starts in the interactive shell and then when the do things frequently, they put it into a simple script and when then need it to be more formal, they invest in making it production quality.

That is the flow that PowerShell was designed to support.

Jeffrey Snover [MSFT]

Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by figgis on Tuesday January 23, 2018 @01:23AM (#16211460)
Could you just allow interaction with objects in a shell while just using c#? There are interactive c# interpreters that already do great.
Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by mattmanser on Monday January 22, 2018 @07:57PM (#16209831)
I still feel it was a massive waste, the millions of programmers who could be using scripting C# right now, it would have been awesome.
Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by ZenoArrow on Monday January 22, 2018 @03:34PM (#16207654)
I realise this is a bit of a cop out, but it's fairly easy to mix and match PowerShell and C# code, even without needing to precompile C# code, by using Add-Type.

It's worth noting that all code in .NET is enclosed within a type (at a fundamental level .NET code is either contained within a value type or reference type, but knowing those names isn't important when you're starting out), so this doesn't limit you to creating/importing data types, you can use it to write inline C# functions too.

It's also interesting to note that the .NET Framework comes with its own .NET compiler, so you don't need to install any dev tools on Windows to code in C#, it's possible to do so with the tools that are available out of the box.

If you want to try out referencing C# code using Add-Type, the following article is a good introduction:

https://blogs.technet.microsoft.com/stefan_gossner/2010/05/0...

Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by InclinedPlane on Monday January 22, 2018 @07:57PM (#16209827)
You know you can write PowerShell cmdlets in C# right? It's super easy.
Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by sgtmas2006 on Monday January 22, 2018 @01:57PM (#16206888)
I love it for both programming and scripting. It's probably not the best option a lot of the time, but I still find myself going back to write things in PowerShell. I don't find myself running into any of the issues you bring up in my experiences. Everyone has something specific they prefer, though. I find coming back to and reading foreign PowerShell to be quite natural, and rarely taxing if formatted well.

I can't pinpoint what I like so much about it either... It just draws me in well. It does devolve in readability when trying to squeeze out every drop of speed, though.

IPC is what I find to be the most challenging for me in PoSH, but I'm not sure if that's due to incompetence.

Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by JeffreySnover on Monday January 22, 2018 @04:56PM (#16208317)
Syntax is like ice cream. Some people like vanilla. Others like chocolate.

Jeffrey Snover [MSFT]

Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by telltruth on Tuesday January 23, 2018 @06:31AM (#16212711)
Syntax is supposed to be composible and intuitive. One shouldn’t have to keep looking docs to find out how to do X. PowerShell has pretty bad, unimaginative and non-intuitive syntax. I was actually chosen many times to keep scripting in old dos syntax because that was more intuitive. Go look in to stackoverflow and forums where people struggle every day on how to do simple things.
Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by wvenable on Monday January 22, 2018 @05:19PM (#16208535)
I can easily program in C#, Java, C, C++, Swift, Python, etc, etc. There are subtle differences, sure, but generally the differences are minor. If they have difference in one area, they have plenty of similarities in others.

If these are flavors of ice cream, they're all pretty similar and taste good. Where is Powershell in this? It's certainly not vanilla or chocolate... it's more like pepperoni. It's like C# and Perl had a really ugly baby. Even simple things like using -eq and -ne for comparisons seems 40 years out of date.

Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by naikrovek on Monday January 22, 2018 @10:05PM (#16210630)
Come on. Could you please try to be constructive with your feedback?
Re:Microsoft’s PowerShell Core Offers Cross-Platform Automation by keithnz on Monday January 22, 2018 @03:26PM (#16207591)
I use powershell a lot to automate a lot of things and I find it great for scripting. However the syntax is a little weird.