r/PowerShell • u/Ckarini • Jul 09 '19
Tutorial on creating PowerShell GUI Applications - Part 2
https://domruggeri.com/2019/07/09/creating-extensive-powershell-gui-applications-part-2/
132
Upvotes
r/PowerShell • u/Ckarini • Jul 09 '19
1
u/lordicarus Jul 09 '19
I've never been a fan of building GUI for PowerShell, but this is really great stuff, keep it up.
In case you're curious, my feeling is that command line tools should stay command line tools. It's basically a sort of philosophical preference. The GUI you are building isn't going to work cross platform (most likely) and depending on things like screen DPI and some of the zoom settings in different versions of Windows, you may end up with things looking really messed up for one user. The command line keeps it all simple. My preference is to create comment based help for each of my more complicated scripts so that every parameter and parameter set is well known and easy to understand.
The most common complaint about GUI with PowerShell is "why not just write the code in VB/C# if you're already designing in VS. The problem with that PowerShell has a ton of modules that make connecting to different services very easy and it's nowhere near as easy, usually, to pull off the same stuff within C#/VB, even if you have more control that way. Sure, you could programmatically create a runspace from within VB/C# in your app that then receives commands based on UI interactions, but that adds even more complexity.
To my very first point, I may not be a huge fan of this, but this is a really good article and so was the first. Great work!