3 ms·
I recently tried to automate windows machines as well. You are spot on. Dealing with obscure objects requires you to make mock calls and try and reflect on the
by jamra 12y ago
I recently tried to automate windows machines as well. You are spot on. Dealing with obscure objects requires you to make mock calls and try and reflect on the underlying types. With bash, you don't have types, just text, which allows you to think outside the box.
Powershell reeks of development with C# on Windows. You have specific function calls that can do very niche things such as convert an application to a virtual machine in IIS. The problem comes up when you are trying to do something novel or just out of the scope of what Microsoft thought up. Bash allows for those things by having separate and reusable components that do their one job well.
Get-Object and Set-Object don't work universally as advertised so you can't just write boilerplate and expect things to work. Instead, you have to google "how do I set up a virtual application?" or "how do I change bindings to an existing virtual application?" You'll get the job done, but you won't feel like you learned anything. I'm glad you wrote this up. It's been something that's been bothering me, but I was having difficulty verbalizing it.
- emn13 12y agoI bet that C# would actually make a better scripting language than powershell - you can actually use most of .net easily (especially generics), and async support is a real boon in scripting. It's mostly missing a decent library to do practical process-glue stuff - the .NET `Process` is verbose, incomplete, and a minefield.