Vexa.psm1

# Get public function definition files and dot source them
$Public = @(Get-ChildItem -Path $PSScriptRoot\public\*.ps1)
$Private = @(Get-ChildItem -Path $PSScriptRoot\private\*.ps1)

foreach ($Module in ($Public + $Private)) {
    try {
        . $Module.FullName
    } catch {
        Write-Error -Message "Failed to import function $($Module.FullName): $_"
    }
}

Export-ModuleMember -Function $Public.BaseName -Alias "vexa"

# Dot-source necessary classes.
. "$PSScriptRoot\classes\VIServer.ps1"
. "$PSScriptRoot\classes\Datacenter.ps1"
. "$PSScriptRoot\classes\ClusterComputeResource.ps1"
. "$PSScriptRoot\classes\HostSystem.ps1"

Register-VexaArgComps