mothe-at / VMPerf-To-Graphite-PowerShell-Script

PowerShell Script to collect statistics from VMWare VCenter Server and send them to Graphite/Grafana
21 stars 4 forks source link

PowerCLI 6.5 #8

Closed rutgerblom closed 7 years ago

rutgerblom commented 7 years ago

With PowerCLI 6.5 the installation path is not published in the Windows registry anymore. We need a new way to find the PowerCLI installation path.

robert-i commented 7 years ago

Even if the information is not available in the registry it should be registered with the environment making it available with get-module like so: Get-Module -ListAvailable -Name VMware.VimAutomation.Core

And finding the path: (get-item (Get-Module -ListAvailable -Name VMware.VimAutomation.Core).modulebase).parent.parent.fullname

mothe-at commented 7 years ago

Thank you for the bug-report and the proposed solution! I have changed the way of finding the init script based on @robert-i 's suggestion. Could you please try the script from the v1.5.2 branch if it works for you? I have tested it in my environment and it seems to be fine.

robert-i commented 7 years ago

Looks good from here also

mothe-at commented 7 years ago

Fixed with version 1.5.2. Get the folder where PowerCLI is installed with $idir = (Get-Module -ListAvailable -Name VMware.VimAutomation.Core).ModuleBase instead of reading the registry.