Have recently updated the vSphere PowerCLI to version 5 on a server.
Have since discovered an issue with the invoke VM script commands and now require vSphere PowerCLI 4.1.1 for 1 particular script.
Was wondering if I could somehow have the vSphere PowerCLI 4.1.1 cmdlets in a different folder register them as an different PSSnapin and just load them in from the different location at the start of the script?
Maybe something like this?
Add-PSSnapin VMware.VimAutomation.Core4.1.1
"C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\Scripts4.1.1\Initialize-PowerCLIEnvironment.ps1"
Anyone have any ideas on how this can be done of if it would even work?, ideally don't want tho have to roll back for 1 script.
Afaik that is not possible, that's why I use ThinApp-ed PowerCLI to have different builds.
Your best bet is to use a VM and install the 4.x version on there.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for you quick reply
Are ThinApp-ed PowerCLI version availiable to download?
Don't really know much about ThinApp is it a licenced product that you need servers for?
Would like to keep all the scripts together where possible but might have to look at moving it.
I don't think there are ThinApp-ed packages available for free download.
You do need licenses to create and run ThinApp packages.
There is no need for a server, just a host where you can do the captures and create the packages.
Have a look, there is a free evaluation center.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference