PowerShell Universal root module loading

PowerShell Universal root module loading

avatar

We are using a root module in PowerShell Universal. When I add the root module configuration to the `"Data": {}` section of `appsettings.json`, no errors occur, and the module appears to load correctly. Like this example: https://docs.devolutions.net/powershell-universal/platform/modules#example

However, when I reload all configurations through the GUI, the root module and all other modules no longer load. If I remove the root module setting from `appsettings.json`, everything works as expected again.

I would like to load the root module through `appsettings.json` because it seems that PowerShell Universal loads modules in alphabetical order.

For example, I have a module called `MODULE.Aa`, which uses a variable defined in my `MODULE.Root` module. Since `MODULE.Aa` appears to load before `MODULE.Root`, the variable is not available when `MODULE.Aa` runs, causing an error.

Is there a way to configure the root module so that it loads correctly and its variables are available to other modules, even after reloading all configurations through the GUI?

All Comments (0)