Can you write a bash one-liner that gets the free memory of your system? Is the awk blackmagic better than selecting an item of an object? Of course new things will be harder to write but it’s a people problem not something inherent with PS.
I find cut easier to use than remembering awk syntax. So I get where you're coming from, but it's just a tad disingenuous don't you think? Especially since `free` `man free` is definitely easier to remember than Get-Whateverfunctioncall is
Your assumption is wrong. Why would you double down on a bad argument? Don't you have a linux environment to type man free in before making that claim?
It's just an overall bad argument. I don't see how `Get-CimInstance -Class Win32_OperatingSystem` is in any way memorable
How is expecting man free to point to the stdlib function a bad argument? man malloc goes to the function so why shouldn't man free? How would anyone just know that the command free exists _without already being familiar with a linux environment_ ?
It's the same on Linux, depending on what manpages you have installed. free(1) is the binary. free(3) and free(3p) are the C function.
If you have more than one installed, `man` might decide to show the first one or it may interactively ask you to pick one, depending on whether it's been configured to be "posixly correct" or not.
procps may not be installed by default on BSDs or VMS or whatever other *nix flavour the person has. But then again quite a few of those systems also don't use bash as default shell(or at least didn't use to), so when the person above asks about "writing a bash script to just do" it's safe to make some assumptions about the target audience.
is the writing part really what we should focus on in scripting though?
i personally would've put much more weight into the ease of reading and understanding the code.
personally, i think that PS just came too late, so most people (me included) are too used to the way the unix shell works/feels. It would have to be just straight up better in all regards to displace it, but its more like a different flavor entirely.
It however a very interesting take on scripting, in my mind it was more comparable to python repl then bash though, but i haven't really used it much.
I think bash is only readable because pretty much everyone is already familiar with the syntax. Given someone with no experience, they would probably have more success understanding what a Powershell script is doing.
Wait, are you seriously trying to tell me that bash is more readable than PowerShell? Excuse me, but what alternate timeline did you accidentally stumble in from?
I said that a lot of people (me included) are more used to Unix shell scripting. If PS had been released 30yrs ago, things wouldve probably been different.
People have however already become comfortable with Unix shells, so it needs significant improvements to convince them to switch the tool of choice. While PS does have improvements, they're not significant enough to relearn everything.
To me, Unix scripts are more readable though, this is simply because Ive been writing them for so many years now, while I barely touched any PS code.