VMware Cloud Community
StuDuncanHPE
Enthusiast
Enthusiast
Jump to solution

Powershell input filtering help

So, this is really not PowerCLI directly, but I thought someone might have already had a solution for this.

I'm looking to have a single form with 3 input fields where input1 filters input2 and input2 filters input3. For example:

User input1: type in vcenter URL (then do a read only login behind the scenes)

Input2: shows list of clusters in vcenter of input1

Input3: shows list of hosts in cluster chosen in input2

I currently have it popping up a window for each input, but trying to simplify it for end users:

Add-Type -AssemblyName Microsoft.VisualBasic
$vc = [Microsoft.VisualBasic.Interaction]::InputBox("Enter the FQDN of the vcenter you want to standardize hosts.", "vCenter")
connect-viserver -server $vc -Credential $cred
$cluster = Get-Cluster | sort | Out-GridView -Title "Select the Cluster to standardize." -OutputMode Single
$host = $cluster | Get-VMHost | sort | Out-GridView -Title "Select the Host to standardize." -OutputMode Single
 
Is there any pwershell form building that allows this without diving deep into .NET form building?
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You might want to have a look at Microsoft.PowerShell.ConsoleGuiTools.
It runs cross-platform.

A good introduction can be found in 
The Ultimate Guide to Terminal User Interfaces in PowerShell

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

You might want to have a look at Microsoft.PowerShell.ConsoleGuiTools.
It runs cross-platform.

A good introduction can be found in 
The Ultimate Guide to Terminal User Interfaces in PowerShell

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
StuDuncanHPE
Enthusiast
Enthusiast
Jump to solution

$Dialog.Title = "Whoa"

 

I think the Selection Events is exactly what I'm looking for.

 

Thanks for the pointer!!

0 Kudos