header image

Module path

Posted by: | August 30, 2009 | No Comment |

PowerShell v2 has 2 default locations for modules – in the install directory and in your profile.  My demo laptop is set to dual boot Windows 7 & Windows 2008 R2.  It would make sense to only maintain one set of files for the modules I write. There is a PowerShell automatic variable that sets where PowerShell looks for modules.  To add my own folder to that path I just add

$env:PSModulePath = "C:\Scripts\Modules;" + $env:PSModulePath

to my profile.  The modules will be available now from either machine.  Need to change drive letter in the Win 2008 profile but otherwise just the same.

Technorati Tags: PowerShell v2,Modules
under: Uncategorized