Created
January 19, 2012 18:19
-
-
Save CalvinRodo/1641637 to your computer and use it in GitHub Desktop.
Improved Module Loading in Windows Powershell profile.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Add the profile path to the environment path variable | |
$ProfileRoot = (Split-Path -Parent $MyInvocation.MyCommand.Path) | |
$env:path = ";$ProfileRoot" | |
#Load all of the modules from ./Modules/* that aren't already loaded. | |
(gci $ProfileRoot"/Modules") | ForEach { if ( -Not( Get-Module $_.Name ) ) { Import-Module $_.Name; Write-Host Importing Module: $_.Name } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pretty sure this will break existing paths, don't you mean this?