February 4th, 2015

PowerTip: Override Modules in PowerShell Session

Doctor Scripto
Scripter

Summary: Learn how to override the modules you have imported into your Windows PowerShell session.

Hey, Scripting Guy! Question How can I re-load the Windows PowerShell module that I am developing so I can test the changes at each
           stage of development?

Hey, Scripting Guy! Answer By default, if you have a module loaded into to your Windows PowerShell session and you attempt to re-load it,
           nothing happens because Import-Module discovers it is already loaded. Use the –Force parameter to ensure
           that a fresh copy of the module is loaded and you get your latest features:

Import-Module <mymodule> -Force

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.