Has anyone else noticed that in PowerCLI 5.0.1 it no longer shows which server(s) you are connected to in the title bar? Is there a simple workaround short of me writing my own Connect-VIServer function (no big deal if I have to, but kind of a nice feature to lose in my opinion).
If you have connected more vCenter or ESXi servers at the same time, you can use the following modification of Luc's script to get the pre version 5.0.1 behaviour:
(Get-Host).UI.RawUI.WindowTitle = "VMware vSphere PowerCLI 5.0.1 - "+[string]::Join(',',$defaultVIServers)
Is it correct that these solutions are rather static?
Within PowerCLI 4.x the title bar would change when connecting or disconnecting to/from vCenter instances.
Would be very nice to have the PowerCLI 5 title bar to be just as dynamic.
you are right. These solutions are rather static. The new implementation of the Connect-VIServer and Disconnect-VIServer don't have an option to get the old behaviour, which I also liked more. Maybe VMware will change it back to the old behaviour in the next version, if complain enough.
Otherwise we will have to write proxy functions.
Until the PowerCLI Team brings back the old title bar, you can use proxy cmdlets as I described in my Proxy cmdlet revisted: Connect-VIServer and Disconnect-VIServer post.
You can also use the proxy functions from my blog post: PowerCLI 5.0.1 Connect-VIServer repaired.
Ha ha. I guess I'll join the link-to-your-own-blog club now. We (me and mattboren) wrote these functions the day I started this thread but just got around to composing a blog post a few hours before Luc posted his own. Guess I should've finished it over the weekend like I originally planned!
We took a different angle than you and Luc, mainly because I've had my own functions for Connect- and Disconnect-VIServer for a while now so just added the new "Change-TitleBar" function to them. I guess it has the advantage of not having to worry about new functionality being added to the default cmdlets, but other than that is just a simple fix while we hope the PowerCLI crew brings this functionality back.