getKtorModulesByPriority

Retrieves all implementations of KtorModule subclasses in the given environment, sorted by decreasing priority.

You should be able to use the output of this function as is in a for-each, like:

getKtorModulesByPriority(...).forEach { install() }