Compatible with Visual Studio Code (PowerShell)

This commit is contained in:
刘祺 2017-06-23 18:39:36 +08:00 committed by GitHub
parent 89c014bb05
commit a7237370e3

20
vendor/profile.ps1 vendored
View File

@ -4,19 +4,23 @@
# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED # !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
# !!! Use "%CMDER_ROOT%\config\user-profile.ps1" to add your own startup commands # !!! Use "%CMDER_ROOT%\config\user-profile.ps1" to add your own startup commands
# We do this for Powershell as Admin Sessions because CMDER_ROOT is not beng set.
if (! $ENV:CMDER_ROOT ) {
$ENV:CMDER_ROOT = resolve-path( $ENV:ConEmuDir + "\..\.." )
}
# Remove trailing '\'
$ENV:CMDER_ROOT = (($ENV:CMDER_ROOT).trimend("\"))
# Compatibility with PS major versions <= 2 # Compatibility with PS major versions <= 2
if(!$PSScriptRoot) { if(!$PSScriptRoot) {
$PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path $PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path
} }
# We do this for Powershell as Admin Sessions because CMDER_ROOT is not beng set.
if (! $ENV:CMDER_ROOT ) {
if ( $ENV:ConEmuDir ) {
$ENV:CMDER_ROOT = resolve-path( $ENV:ConEmuDir + "\..\.." )
} else {
$ENV:CMDER_ROOT = resolve-path( $PSScriptRoot + "\.." )
}
}
# Remove trailing '\'
$ENV:CMDER_ROOT = (($ENV:CMDER_ROOT).trimend("\"))
# Add Cmder modules directory to the autoload path. # Add Cmder modules directory to the autoload path.
$CmderModulePath = Join-path $PSScriptRoot "psmodules/" $CmderModulePath = Join-path $PSScriptRoot "psmodules/"