Home Blog “Running” PowerShell Modules

“Running” PowerShell Modules

In the default ISE editor, you can load and edit .psm1 fies (PowerShell modules). You cannot, however, run or debug them. ISESteroids changes that.

Why Modules Cannot Run…

The default ISE behavior is by design. PowerShell modules are no scripts. Instead, modules run automatically when you import the module.

So to test PowerShell modules, you would have to import the module manually to invoke the *.psm1 file in your editor.

Why Modules Can Run in ISESteroids…

In ISESteroids, we changed this slightly. Here, you can run PowerShell modules just as if they were scripts. The green “Play” button is available, and so is the keyboard shortcut F5.

ISESteroids automatically detects that you are about to “run” a module. So it automatically imports the module for you, and makes sure it is freshly imported by adding the switch -Force. You can see this in the interactive console, too, where ISESteroids adds the appropriate commands for you.

This way, test-driving and running PowerShell modules becomes a natural experience, and is just as easy as running a plain PowerShell script.