Functions/ModuleManagement/Import-BcModule.ps1
function Import-BcModule { [CmdletBinding(DefaultParameterSetName='ServerInstance')] Param ( # Gets the modules compatible with the supplied serverinstance. [Parameter(ParameterSetName='ServerInstance', Mandatory = $true)] [string] $ServerInstance, # Gets the modules compatible with the supplied BcVersion. E.g. 'bc15' or 'bc13'. [Parameter(ParameterSetName='BcVersion', Mandatory = $true)] [string] $BcVersion, [switch] $ManagementModule, [switch] $AppManagementModule, [switch] $AppToolsModule, [switch] $Force ) $arguments =@{ 'ManagementModule' = $ManagementModule 'AppManagementModule' = $AppManagementModule 'AppToolsModule' = $AppToolsModule } if($BcVersion){ $arguments += @{ 'BcVersion' = $BcVersion } } if($ServerInstance){ $arguments += @{ 'ServerInstance' = $ServerInstance } } $modules = Get-BcModule @arguments $modules | Import-Module -DisableNameChecking -Global -Force:$Force } Export-ModuleMember -Function Import-BcModule |