PowerShell v1.0 is obviously a console based administrative shell. It doesn't really require a GUI interface. If one is required, like the Exchange 2007 management GUI, it is built on top of PowerShell. You can create your own GUI using Windows Forms in a PowerShell script. My question is, "What sort of PowerShell scripts or management tasks do you think would be best served with the addition of even a simple graphical interface? What have you created winforms to accomplish?"
相关问题
- How to Debug/Register a Permanent WMI Event Which
- How can I do variable substitution in a here-strin
- How to use a default value with parameter sets in
- Does powershell have a method_missing()?
- How do I bind a DataGridViewComboBoxColumn to a pr
相关文章
- 在vscode如何用code runner打开独立的控制台窗口,以及设置好调试模式时窗口的编码?
- C#调用PowerShell的问题
- EscapeDataString having differing behaviour betwee
- Sort TreeView Automatically Upon Adding Nodes
- Where does this quality loss on Images come from?
- Is there a non-java, cross platform way to launch
- Missing partial modifier on declaration of type
- Compile and build with single command line Java (L
My favorite old gui tool for a command line shell was a select directory tool that when exectued from the command line would open a gui directory selection dialog. Very help full when you have to cd to some other directory with a long path name.
I couldn't find the old exe tool I used to use unfortunalty. (It was pre-powershell anyway) Also, I'm not familiar enough with powershell to figure out how to call the dialog from powershell directly and make this a cmd-let or whatever, but here's what I'm talking about with some python mixed in.
Here it is:
And the python code:
I'd like to have this tool again, if anyone knows how to clean this up so I can just call a command like, "cdir" or something please comment.
Isnt this mainly used by powershell guys who want to make there scripts pretty before handing to users or people who know nothing about a console and like pretty pictures ?!
I'm hopeful for some examples here because I'm sure there's loads of tasks I would be able to delegate down if they had a pretty UI on them and were usable with a mouse.
But as far as adding a user interface, I'm having trouble of thinking of a spot where there's not one. Most of the examples I can think of are either just dumbing down or exposing a selected section of an existing UI. They are typically just a different view to the existing data that's not there, or hard to see in the provided management console. Or they extend some functionality with looping or pipelining (you can still use the mouse to change the names of 200 files if you want). Almost everything I've done that's still in use is either one-shot scripts, or sitting as a scheduled task somewhere.
I'm waiting for ideas :)
In answer to monkut's suggestion, here's a simple function to get file paths using the WindowsForms
OpenFileDialog
:I also tried creating a similar
Select-Directory
function, butFolderBrowserDialog
's STA thread requirement is rather difficult to achieve in PowerShell v1.Edit: Thanks to Gordon, here's a workaround to show the
FolderBrowserDialog
using COM:Actually, thinking more about this, In the examples I have seen that use a GUI they seem to be multiple input front ends, something that is done alot easier than a command line with several switches which may be quite long and harder to visualise.
I would head over to the PowerGUI site which I'm sure you are already aware of Jeff. The sort of things that users are doing there are what I would consider exemplars of the fusion of powershell and a GUI. The ability to generate a list of objects then drill down into the hierarchical structure of the objects, or run scripts on an object. This sort of thing is where I would see a GUI interface shine.