Alat.PSSp.psm1

$PSModule = $ExecutionContext.SessionState.Module
$PSModuleRoot = $PSModule.ModuleBase

$binaryModuleRoot = $PSModuleRoot

if (($PSVersionTable.Keys -contains "PSEdition") -and ($PSVersionTable.PSEdition -ne 'Desktop')) {
   $binaryModuleRoot = Join-Path -Path $PSModuleRoot -ChildPath 'black'
}
else {
   $binaryModuleRoot = Join-Path -Path $PSModuleRoot -ChildPath 'blue'
}

$binaryModule = Import-Module -Name (Join-Path $binaryModuleRoot 'Alat.PSSp.PSModule.dll') -PassThru

$PSModule.OnRemove = {
   Remove-Module -ModuleInfo $binaryModule
}