VMware Cloud Community
banerian
VMware Employee
VMware Employee

what happened to connect-viserver popup

Hey, is it me or did something happen to the connect-viserver popup widget thing?

It used to be that if I ran something like

$VCS = connect-viserver

A great little popup widget would appear that allowed me to enter in 'n' number of VCs all at one time.  Then I could 'foreach' through them as my script did its thing.  Life was good.

I recently upgraded my PCLI and now that widget seems to have gone away.

What happened?  How can I get it back?

John

Reply
0 Kudos
10 Replies
LucD
Leadership
Leadership

The latest PowerCLI build introduced the -Menu parameter for the Connect-VIServer cmdlet, which allows you to select a server from your history of connections.

Connect-ViServer -Menu

It's not exactly the same as what was there, but I think it is an improvement.

The Connect-VIServer now has 2 parameter sets, Default and Menu. The Default parameterset is the one with the -Server parameter, the Menu parameterset is the one with the -Menu parameter.

Note that although the documentation and the cmdlet's metadata says that -Server is not a mandatory parameter, the error message seems to indicate it is

connect-mandatory.png


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

Reply
0 Kudos
admin
Immortal
Immortal

Luc,

I filed a bug for this issue.

Vitali

PowerCLI Team

Reply
0 Kudos
banerian
VMware Employee
VMware Employee

No.

This new behavior is great if you're only running against one VC.

The great thing about the PCLI is the ease at which you can run against multiple VCs, to pull data summary information, for example.  The new method is completely non-supportive of this.

Thanks for the response though.

John

Reply
0 Kudos
LucD
Leadership
Leadership

I'm not sure I understand your reasoning here.

With the new feature you can have multiple vSphere servers open in parallel.

Most cmdlets will then run against all the open connections.

You can still limit a cmdlet to a specific server with the -Server parameter.

Notice also that I said 'can', if you don't want that feature use the Set-PowerCLIConfiguration cmdlet to switch to single mode.


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

Reply
0 Kudos
admin
Immortal
Immortal

Hi John,

This is regression happend in the latest release. The bug was updated with explanation what has happend.

The workaround of your use case is to pass directly the server array on the command line:

PS> Connect-VIServer -Server 'server1', 'server2','server3' .....

Vitali

PowerCLI Team

Reply
0 Kudos
banerian
VMware Employee
VMware Employee

With the new feature you can have multiple vSphere servers open in parallel.

How do you do this with the new popup?  When I specify the -Menu option I get to only pick one VC at a time.

Reply
0 Kudos
LucD
Leadership
Leadership

Like Vitali just explained.

Connect-VIServer -Server server1,server2,server3

The Server parameter accepts an array of strings.


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

Reply
0 Kudos
banerian
VMware Employee
VMware Employee

Ok, yea, that's the thing.  I don't want the VCs in the script.  I want to enter them at runtime.

Wanted to make sure I understood what you meant.

Reply
0 Kudos
LucD
Leadership
Leadership

Still no problem, use the $args variable.

In the script you put

Connect-VIServer -Server $args

....

Save the script as MyScipt.ps1.

Now you can call it like this

.\MyScript.ps1 "Server1" "Server2" "Server3"

No names in the script.


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

Reply
0 Kudos
banerian
VMware Employee
VMware Employee

That's a decent idea.

Still like want my old 'n' VC popup back though.

Thanks as always LucD

Reply
0 Kudos