4 ms·
I've been using PS for quite a bit of AWS automation lately and I have to say that I don't like it. Sure, you can pass objects around, but I've happened upon m
by Corrado 10y ago
I've been using PS for quite a bit of AWS automation lately and I have to say that I don't like it. Sure, you can pass objects around, but I've happened upon more than one cmdlet that does the wrong thing with the incoming object. In one case I was passing a "String" object to a cmdlet that accepts strings and it didn't know what to do with the object so it generated a fairly obtuse error. I had to manually cast the String object to a string. Grrr...
Another thing that bothers me is the lack of single line composability. In most Unix shells you can pipe things around with abandon; it's not pretty but it works. One more than one occasion, while working with PS, I've had to create a cmdlet because there is no way (or I don't know how) to store intermediate values between cmdlets. One example was processing things in a loop. I had to store the current value in a variable and then process that variable in another line. I know someone here will give a solution, but I looked for an hour before giving up and creating a script file.
On top of everything else, the cmdlets from Microsoft have differing switches for the same thing. One command might use -ServerName while another command will use -ComputerName. So, basically, you end up looking everything up before you can use it. I know Bash isn't much better, but at least I can expect that the tools are separate and not really designed to work together. I was expecting more consistency from PowerShell.