Check if script/module is running inside of PSU

Check if script/module is running inside of PSU

avatar

I’m offloading the logic and functional backend parts into dedicated powershell modules. This way it’s possible to test these parts outside of PSU.

Is there a way to check if the module is loaded from within PSU or not? From within the module? This would allow me to use e.g. the Server Cache if running within PSU or just simply use a global variable for testing from outside of PSU.

Product: PowerShell Universal
Version: 3.9.3


All Comments (1)

avatar

You could key off one of the built-in variables.

docs.powershelluniversal.com

Adam Driscoll
PowerShell Expert and Developer at Devolutions