Fix for non-default install directory#3
Fix for non-default install directory#3NamedJason wants to merge 2 commits intoPowerCLIGoodies:masterfrom
Conversation
This will allow the module to work if PowerCLI is installed in a non-default directory (or if the workstation is 32 bit Windows).
|
Nice fix. |
|
Yes, good catch -- thanks for creating a fix, @NamedJason. My thoughts on this not working for PowerCLI 5.x: PowerCLI 6.x has been out since Mar 2015, so it seems that there has been ample time for people to get current with their PowerCLI install. And, if there are still some people that, for some reason, "must" stay on a PowerCLI 5.x version, they can stay on v1.0.1 of the DRSRule module... As for the bit in the updated code that "creates" the path to the given .dll from the module path, I suggest that we leverage some path-management cmdlets like use something like: A bit longer, but keeps us away from manual string manipulation. Matt |
|
How about this? $pcliDLL = join-path -path (get-installpath) -childpath "VMware.Vim.dll" I'm skeptical of it because it seems too simple... |
|
Ok, with the PowerCLI 6.x requirement, but then we should add something like this. #Requires -Modules VMware.VimAutomation.Core, @{ModuleName="VMware.VimAutomation.Core";ModuleVersion="6.0.0.0"} |
This one has the #requires statement that Luc recommended and the simplest path generation technique that we came up with.
|
I'm not super familiar with GitHub, but I think that I changed this pull request to use that #Requires statement and the join-path (get-installpath) technique to populate pcliDll. |
This will allow the module to work if PowerCLI is installed in a non-default directory (or if the workstation is 32 bit Windows).