WahlNetwork / vester

Easily validate and remediate your vSphere configuration
https://wahlnetwork.com
Apache License 2.0
146 stars 45 forks source link

External dependencies not consistently defined #194

Open ghost opened 6 years ago

ghost commented 6 years ago

Dependencies on external, environmental (powershell) configuration is not consistently defined.

Expected Behavior

AS A user of the project I WANT to have consistent method to identify module dependencies SO THAT I can easily and quickly ensure my environment is configured correctly to use this module.

Current Behavior

Example from New-VesterConfig, lines 157 to 163:

    # Secondary modules...PowerCLI doesn't do implicit module loading as of PCLI 6.5
    # This is all the effort I'm willing to put into working around that right now
    Try {
        $Network = $Datacenter | Get-VDSwitch -Name $config.scope.vds -ErrorAction Stop
    } Catch {
        Write-Warning 'Get-VDSwitch failed. Have you manually imported module "VMware.VimAutomation.Vds"?'
    }

Possible Solution

In no particular order:

After one or both of the above is implemented, remove try/catch fro New-VesterConfig.

Context

As a user, this has had no negative impact to me. As a contributor this has added complexity when reading through the code.

Your Environment

midacts commented 6 years ago

Agreed.

I think that is a legacy issue (meaning that code existed prior to PowerCLI being on the PowerShell gallery).

I would recommend we remove lines of code like that and add 'VMware.PowerCLI' as an external module dependcy to the module manifest