Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: PowerCLI front end tool

$
0
0

Here’s how I would approach it:

1. Create a module with one PowerShell command for each task you need to accomplish using PowerShell (e.g. Get-VMwareActiveSnapshot). Create these so that they can be run and tested independently when passed vCenter credentials. Don’t have these output data into the database, that should be done separately to allow for isolated execution and testing independent of their integration into your tool.

2. Define a string table (you could use a psd1 file and then convert its contents using ConvertFrom-StringData) that provides friendly display names for the commands you have written in your module. Use these names when displaying the tasks that can be run through the dashboard, as well as when looking up the script that would be run when a given display name is selected.

3. Write a command that can get a list of the display names for the commands that are written, so that you can display those names on the dashboard for users to choose from.

4. Write a script/command that can invoke one or more commands in your module using a display name (which would then be used to look up the actual name of the command that would be run). This would be where I would work with SQL Server. You could push objects with individual properties into custom tables based on the command name or you could convert the objects into HTML tables for easy processing/display on the client and simplified storage in SQL Server. This can also be executed in isolation for testing purposes.

That’s just off the cuff, without thinking too hard about the problem. I hope this helps.


Viewing all articles
Browse latest Browse all 13067

Trending Articles