This is a feature request.
I would love to have somehwere in the service config the ability to declare PowerShell code that will be run before every custom command powershell script.
This could be used to define reusable objects, like global method, global variables, credentials, ...
Use case: I often need to enforce the same check during a object creation and modification that lead to code deduplication.