mirror of
https://github.com/cmderdev/cmder.git
synced 2025-02-10 23:49:07 +08:00
Merge pull request #1417 from gucong3000/patch-2
Compatible with Visual Studio Code (PowerShell) integrated terminal.
This commit is contained in:
commit
7479d620b1
20
vendor/profile.ps1
vendored
20
vendor/profile.ps1
vendored
@ -4,19 +4,23 @@
|
||||
# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
||||
# !!! 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
|
||||
if(!$PSScriptRoot) {
|
||||
$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("\"))
|
||||
|
||||
# do not load bundled psget if a module installer is already available
|
||||
# -> recent PowerShell versions include PowerShellGet out of the box
|
||||
$moduleInstallerAvailable = [bool](Get-Command -Name 'Install-Module' -ErrorAction SilentlyContinue | Out-Null)
|
||||
|
Loading…
Reference in New Issue
Block a user