Microsoft Announces PowerShell 7
Microsoft has just announced PowerShell 7, a new major release that comes only a few days after the company originally introduced version 6.2
And while it naturally makes more sense for the company to roll out PowerShell 6.3 rather than a whole new version 7.0, the company explains in a blog post that it's all as part of the efforts to align the versions of all platforms.
Steve Lee, Principal Software Engineer Manager, PowerShell, explains that Microsoft noticed a growing usage pattern on Linux, but not on Windows.
"Windows usage has not been growing as significantly, surprising given that PowerShell was popularized on the Windows platform," Lee explains. [...] The next version of PowerShell will thus be available on Windows, Linux, and macOS, and the company explains it'll be available with LTS (Long Term Servicing) and non-LTS plans.
Also at ZDNet.
Previously: MS Releases Powershell SDC - to Manage Config for.... Linux
Powershell for Linux
Your wget (and curl) is Broken and Should DIE, GitHubbers Tell Microsoft
(Score: 3, Interesting) by looorg on Tuesday April 09 2019, @01:38AM (16 children)
So nobody has anything positive to say about Powershell? Not even anonymous so not to ruin all your tux-cred with the neckbeards?
I have not tried it yet -- I have not even checked the syntax, but I will admit that it is mildly interesting. It comes with Windows that the corporate overlords supply computers for at work, I don't have to download anything else and if it can easily be used to cobble together some scripts to do boring mundane tasks in the windows environment it might be ok.
(Score: 0) by Anonymous Coward on Tuesday April 09 2019, @03:18AM (6 children)
So nobody has anything positive to say about Powershell? Not even anonymous so not to ruin all your tux-cred with the chestbeards?
There, FTFY.
(Score: 3, Insightful) by evk on Tuesday April 09 2019, @08:36AM (5 children)
Powershell has this nice idea of shuffling around objects instead of undefined data streams. So if you pipe a directory listing to something, you don't get a bunch of text that you can parse. You get objects with properties. This isn't a bad idea. For some reason they managed to mess up lots of small details which makes it surprisingly compex to to do things you'd expected to be easy.
In bash I can usually write a one liner without referencing any documentation. For powershell I have a library of one liners for most things I wan't to do. Writing them from memory doesn't work for me.
(Score: 4, Interesting) by choose another one on Tuesday April 09 2019, @11:45AM (3 children)
This. The idea that you have to turn everything into text and then parse it back out is actually the bad idea, and the source of so many bugs and exploits, but it is so ingrained in unix that we just take the breakage as being inevitable.
I (very)vaguely recall years ago (probably before powershell) something similar was talked about for Guile (the GNU scripting lang) - I haven't kept up with Guile so don't know where it went or if that got implemented. There are GPL problems with it though (see last bit of https://www.gnu.org/licenses/gpl-faq.html#MereAggregation [gnu.org] ) - basically the whole pipeline becomes one program for GPL purposes, maybe (court will decide...).
That is pretty much Microsoft's MO.
Thing is, PowerShell's big advantage is also it's biggest drawback here - all the functions all the objects all the properties, they are the .Net ones. IF(F) you are a .Net/C# dev (or maybe VB) then PowerShell is just a bit of slightly twisted syntax to learn, then everything you usually do in C# you can do in a script, and that actually is awesome. On the other hand if you are NOT a .Net/C# dev then you have to learn not just powershell, but the entire .Net framework, for a one line script.
PowerShell is at least vaguely readable once you've written it. I used to be able to write Perl from memory, but I still had/have a library of one liners for Perl. Now, I dare not run them because I know not what they do...
(Score: 0) by Anonymous Coward on Tuesday April 09 2019, @02:52PM (2 children)
I call BS on this.
I am definitely not a .net or MS gal - Yes, Debian stole my heart of geek. I do have to admin Windows boxes. I do have to patch and maintain and support MS products inc Exchange SharePoint and Skype. You don't need to know .net to use PowerShell. It is useful to know how .net works and what's in it. For most things use the functions available and look up what you need when you need it.
I've coded in perl bash py CSH Java (yes yes) DOS batch and frankly after using PowerShell for several years I miss it when using Ubuntu or redhat. No, the Linux version of powershell is not up to scratch. Nice try though.
If not PowerShell then ... What? C#? Ask Microsoft to install python by default on all Windows machines? Install perl everywhere? Do it all in .NET?
(Score: 0) by Anonymous Coward on Wednesday April 10 2019, @07:06PM (1 child)
"I do have to admin Windows boxes. I do have to patch and maintain and support MS products inc Exchange SharePoint and Skype."
no. you don't "have to" do anything. have some self respect instead.
(Score: 0) by Anonymous Coward on Thursday April 11 2019, @11:32AM
Sure.I can starve.
(Score: 0) by Anonymous Coward on Tuesday April 09 2019, @06:36PM
Great summation.
I'm not a Programmer with a capital P, but I do lots of shell scripting as part of system administration tasks; I've worn both linux and windows hats for the last 15 years and I've done extensive scripting on both OSes. Powershell is to me more of a programming language than a shell - it makes what I'm used to being a simple set of operations, turns them into a load of overly verbose commands, and then you have to either spend half your life piping into `get-member` or `select-object -property *` to see if the info you want was actually there or not, or if you maybe need to go and grab from some other object or convert that particular int into a datetime; bash and friends show you everything and provide you with really awesome tools for throwing away or converting stuff you don't want.
I'm working in a windows team currently but we've been bringing in a lot of linux kit. Lots of the people were agog at having someone who could do "linux scripting", thinking it was some sort of prodigal thing; after showing them a few basic utils and some loops in bash they all took to it remarkably easy, because it's so much more WYSIWYG in nature than futzing around in powershell. bash and other *sh's make the transition from "remember this command" to "put this list of commands in a file and run it" to "wrap those commands in some logic and variables" really simple and really natural in a way I've just never experienced with powershell. Ultimately I don't think I've got an object-oriented brain because despite writing powershell stuff for over ten years now it still doesn't come naturally to me whereas bash scripts just trip off the fingers.
Conversely, powershell allows you to do certain far more powerful things than you could realistically do in bash (writing REST interface stuff in JSON being a trendy example... but it was whilst porting a powershell script I wrote to linux that I discovered the python requests library which made the script even more bone-headedly simple than powershell) but the barrier to entry is much higher than I feel it is for bash. That said there's a whole bunch of windows utilities with very deep and very useful powershell interfaces that even python on windows can't hold a candle to, but those feel more of a necessary evil to me than a boon of powershell itself.
My two cents.
(Score: 3, Interesting) by NotSanguine on Tuesday April 09 2019, @03:28AM (4 children)
I've used powershell.
It's okay. It really doesn't work as well or provide as much power or flexibility as other scripting languages, but for managing Windows and AD, it provides a modicum of utility.
Please understand that powershell isn't like perl or python. It really has no utility outside sys admin and management functions.
A good way to think about it is that it's like an inferior sh/bash/csh/etc. with some libraries that make interfacing with proprietary Windows stuff easier.
No, no, you're not thinking; you're just being logical. --Niels Bohr
(Score: 2) by rob_on_earth on Tuesday April 09 2019, @07:48AM (3 children)
This this this!
Powershell is not bash.
I hated Powershell for so long, because to do things the *nix way is painful(but never impossible). Once I found I had sometime to properly learn Powershell for managing specific Windows/Microsoft processes/systems with very specific goals it just works.
As with the Apple eco system, the moment you want to go off-road the wheels fall off.
As with the last big release of Powershell the biggest hurdle will be getting the majority of people to upgrade to make it relevant. I know of many systems that "just work" with old versions of Powershell and no on knows how they work or how to upgrade them.
With the WSL I try my best to avoid Powershell, but there a few things it does very well in its own domain.
(Score: 2) by hendrikboom on Tuesday April 09 2019, @12:06PM (2 children)
Not the World Surf League, I'm sure, which is what Google tells me for WSL.
(Score: 2) by rob_on_earth on Tuesday April 09 2019, @02:06PM (1 child)
it's the 10th result on the second page.
and, yes, I blame Microsoft
(Score: 2) by hendrikboom on Wednesday April 10 2019, @03:19PM
Windows Subsystem for Linux? Probably, yes.
(Score: 0) by Anonymous Coward on Tuesday April 09 2019, @05:28AM
I used it once, but don't remember what for. Evidently, it was a forgettable experience.
(Score: 0) by Anonymous Coward on Tuesday April 09 2019, @08:14AM
I use power shell every day. I am happy it exists on windows. Far better than VB or c# or perl. It is standard on all windows machines. It works. It does take some getting used to.
I am a Linux guy working in a windows centric shop. Without power shell this job would suck a lot more.
Appreciate it for what it is.
(Score: 3, Interesting) by TheFool on Tuesday April 09 2019, @01:14PM
As a general-purpose shell, I think I'd give it a pass. But it's well suited to performing Windows-related tasks. I use it quite a bit when I'm working on things there.
Need to write some tests for your .NET or COM+ application (yes, some of us still write these)? Just suck the interface into your script, and now you can poke at it to your heart's content. Want to poke at a driver and look at the WMI data coming out the side? Just a bit of script. Want to spin up a test VM, then execute all those commands on the guest? Sure, just a few more lines of script.
And there's also the sysadmin side of it, because MS likes to shuffle the GUI around a lot but the commands will stay the same. But I tend not to use it much for that.
So yeah, good if you're running pretty close to "Windows" and not doing generic things like manipulating files. Definitely worth learning in that case. And it's certainly better than cmd.exe, which is your other out-of-the-box option.
(Score: 2) by DannyB on Tuesday April 09 2019, @02:49PM
I have to run Windows, at work. But I've never personally owned a box running Windows. And I am not responsible for maintaining Windows at work. The staff who do that seem to do a good job on a very large fleet.
So what positive thing can I say about Powershell?
This: I don't have to use it!
To transfer files: right-click on file, pick Copy. Unplug mouse, plug mouse into other computer. Right-click, paste.