0

I have a question. I am looking to create a large script that queries multiple values on a large number of servers, and then gives you an output (Gridview or similar) so you can easily view all of the values. Gridview fits the bill, but I was wondering if it is possible to have an interactive output.

For instance, one of the servers has virus definitions that are out of date. I could right click on that row and run a script to update the AV definitions. Is something like that possible from Powershell, or should I be looking at something like C#?

4
  • Well, that depends... are you open to dynamically creating forms or using a webpage as your output? How much of your time is this project worth? Commented Apr 23, 2014 at 15:00
  • I have more than enough time to work on this project, and this is also a learning project for me to see what PowerShell and I can do. PowerShell is my first foray into anything programming. Is there a good resource to get me started on either or both? I have done some things with forms, but nothing too aggressive. Could it all be done with forms? Commented Apr 23, 2014 at 15:05
  • It could, and I can kind of visualize some theoretical structure to things in my head, but I do not know enough about the exact details on forms to give you what you need. Maybe you should look up Primal Forms, I know it can help you generate forms, and the code behind them in a GUI interface. It would be a good chunk more work, but it would be more user friendly and better looking if you take the time on it. Commented Apr 23, 2014 at 15:12
  • Gotcha. Just talking about it is helping. I am sure I could run my query, output to gridview, multi-select and have buttons for any actions that I might perform in a UI. Thanks for helping! Commented Apr 23, 2014 at 15:14

1 Answer 1

3

If you've got Powershell V3 or better, you can use the -OutputMode option of Out-Gridview to let the user select one or more rows from the gridview and send those objects on down the pipeline for further processing.

Depending on your application, you might need to save them to a variable, and then present another gridview of menu options to select what kind of maintenance they want to perform on them, but it's definitely do-able, and much easier than developing a UI.

FWIW, here's a link to a function I wrote that let's you display and select from a gridview of selected properties of an object collection, and then send the original objects down the pipeline.

http://gallery.technet.microsoft.com/scriptcenter/Select-FromGridView-521a56d8

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.