Leverage the Module Autoload path and save doing it ourselves.

This should be faster too as we won't automatically import all functions
to the session. Powershell now knows where to look before declaring they
don't exist.
This commit is contained in:
Jack Bennett 2015-03-18 15:33:55 +00:00
parent 004761b32f
commit e811c60ab2

16
vendor/profile.ps1 vendored
View File

@ -1,18 +1,10 @@
# Global modules directory # Add Cmder modules directory to the autoload path.
$global:PsGetDestinationModulePath = $PSScriptRoot + "\..\vendor\psmodules" $CmderModulePath = Join-path $PSScriptRoot "psmodules/"
# Push to modules location if( -not $env:PSModulePath.Contains($CmderModulePath) ){
Push-Location -Path ($PsGetDestinationModulePath) $env:PSModulePath = $env:PSModulePath.Insert(0, "$CmderModulePath;")
# Load modules from current directory
Import-Module .\PsGet\PsGet
Get-ChildItem -Exclude "PsGet" -Directory -Name | Foreach-Object {
Import-Module .\$_\$_
} }
# Come back to PWD
Pop-Location
# Set up a Cmder prompt, adding the git prompt parts inside git repos # Set up a Cmder prompt, adding the git prompt parts inside git repos
function global:prompt { function global:prompt {
$realLASTEXITCODE = $LASTEXITCODE $realLASTEXITCODE = $LASTEXITCODE