Functions/Install-OptionalModule.ps1

function Install-OptionalModule {
    #PSExcel module
    if($outputs -and $outputs.Contains("excel")){
        if (!(Get-Module -ListAvailable -Name PSExcel)) {
            if($force){
                Install-Module -Name PSExcel -force;
            } else {
                Install-Module -Name PSExcel;
            }
            
            Get-Command -Module PSExcel | Out-Null;
        }
    }
}