News for hackers. Stuff that matters.
Re:A Requiem for a Dying Operating System (1994) by jiggawatts on Friday September 04, 2020 @06:35AM (#24373689)
PowerShell takes the UNIX philosophy, cranks it up to 11, and makes commands trivially discoverable.
Re:A Requiem for a Dying Operating System (1994) by yabones on Friday September 04, 2020 @12:27PM (#24376410)
There are things that powershell does well, but I wouldn't say that it's really all that unixey. It relies far too heavily for the user to have an understanding of the windows object model, which frankly a lot of sysadmins don't have and refuse to learn. In unices the pipeline is just that, a way to send a stream of bytes from one place to another. In pwsh it's more complicated than that since it passes an object along with the preceding command's metadata.

In my personal experience, powershell is fantastic for writing scripts and tooling, but not really so great for actual use as a shell. What makes a good shell is speed and 'muscle memory', imo.

Re:A Requiem for a Dying Operating System (1994) by majkinetor on Friday September 04, 2020 @12:36PM (#24376490)
Thats nonsense really. What windows object model ???

Your 'simple' pipeline becomes hard core once you take into account all other things you require like grep, awk, sed, xargs, mount etc. Hack, even basic boolean stuff is from another dimension with executables like `[` or `true/false` (yeah, I know mostly builtin nowdays)

Re:A Requiem for a Dying Operating System (1994) by enriquto on Friday September 04, 2020 @04:18PM (#24378493)
> your 'simple' pipeline becomes hard core once you take into account all other things you require like grep, awk, sed, xargs, mount etc.

That's the whole point of unix. Non-integrated tools that talk to each other using plain text.

Re:A Requiem for a Dying Operating System (1994) by Arnavion on Friday September 04, 2020 @04:29PM (#24378589)
It's exactly the same for PS.

Just as you have to look at a text output of a unix command to figure out how to parse it and extract the subset of information you need from it, so do you have to look at the help metadata of a PS command to figure out how to extract the subset of information you need from its output.

The advantage of having objects instead of text is that if you thought you could parse the filename of grep matches by substring each line of `grep -H`'s output with `:`, you failed to account for filenames with colons. With PS's sls, its help metadata tells you it outputs `Microsoft.PowerShell.Commands.MatchInfo` objects, and the documentation for that type tells you it has a `Filename` property of type string.

One PS command is not "integrated" with another PS command; they're all integrated to .Net and a bunch of built-in PS types.

Re:A Requiem for a Dying Operating System (1994) by enriquto on Friday September 04, 2020 @04:46PM (#24378717)
Thanks for your answer, and I see where you are coming from. But your unix is not the same as my unix. For me, unix means programs that can be easily written using only the getchar and putchar functions. If you have "types" and whatnot, it's not unix.
Re:A Requiem for a Dying Operating System (1994) by jiggawatts on Saturday September 05, 2020 @09:26AM (#24383354)
It's not often you hear someone criticise a tool for not having enough unnecessary encoding and parsing steps involved.
Re:A Requiem for a Dying Operating System (1994) by enriquto on Saturday September 05, 2020 @12:02PM (#24384547)
Are you talking about people who promote JSON-RPC and whatnot? Sure, they are nuts, but what does it have to do with unix?
Re:A Requiem for a Dying Operating System (1994) by rdhatt on Friday September 04, 2020 @02:35PM (#24377648)
Funny enough given the linked post - Powershell owes it philosophy to VMS as well, e.g. the verb-noun command structure.

https://devblogs.microsoft.com/powershell/verb-noun-vs-noun-...

https://ilovepowershell.com/2013/08/05/microsoft-virtual-aca...

Re:A Requiem for a Dying Operating System (1994) by andi999 on Friday September 04, 2020 @09:12AM (#24374596)
How to discover commands?
Re:A Requiem for a Dying Operating System (1994) by AnIdiotOnTheNet on Friday September 04, 2020 @09:19AM (#24374668)
Powershell pretty much has universal tab-complete. Typing a command, '-', and repeatedly hitting tab will cycle through all available arguments for that command, and arguments will be quite consistent between commands. But you can also tab complete variable names and the commands themselves.

Discovering the cmdlets is not as trivial as it could be, because they are named verb-first instead of noun first. Get-<tab> is not as useful as NetAdapter-<tab> might be, but since things are named sensibly you can do a little guess work and use tab-completion to find what you're looking for in the vast majority of cases.

Re:A Requiem for a Dying Operating System (1994) by majkinetor on Friday September 04, 2020 @09:54AM (#24374925)
> Discovering the cmdlets is not as trivial as it could be, because they are named verb-first instead of noun first

Irrelevant. Use

    Get-Command *network    #network anywhere in noun
    gcm *-network*          #network as first word in noun
PowerShell has it all, its just that people don't bother to learn it.
Re:A Requiem for a Dying Operating System (1994) by andi999 on Friday September 04, 2020 @10:02AM (#24374999)
Which good documentation do you recommend?
Re:A Requiem for a Dying Operating System (1994) by majkinetor on Friday September 04, 2020 @12:38PM (#24376511)
Poweshell in depth, or in month of launches.

But, experience is more important. Simply do everything in posh, even if there is a handy gui. After a few months you are closer to pro then with any books.

Re:A Requiem for a Dying Operating System (1994) by 0-_-0 on Friday September 04, 2020 @10:08AM (#24375037)
should't the first one be "network as last word"?
Re:A Requiem for a Dying Operating System (1994) by majkinetor on Friday September 04, 2020 @12:37PM (#24376500)
Indeed. My bad.
[dead]
Re:A Requiem for a Dying Operating System (1994) by majkinetor on Friday September 04, 2020 @12:36PM (#24376494)
Yes it does. Learn it before commenting.

Furthermore, its definitely way more unixy then any *nix shells.