mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-11-01 01:42:17 +08:00 
			
		
		
		
	fix powershell profile.d
This commit is contained in:
		
							
								
								
									
										18
									
								
								vendor/profile.ps1
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								vendor/profile.ps1
									
									
									
									
										vendored
									
									
								
							| @@ -128,20 +128,30 @@ if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) { | |||||||
| } | } | ||||||
|  |  | ||||||
| pushd $ENV:CMDER_ROOT\config\profile.d | pushd $ENV:CMDER_ROOT\config\profile.d | ||||||
| foreach ($x in Get-ChildItem *.ps1) { | foreach ($x in Get-ChildItem *.psm1) { | ||||||
|   # write-host write-host Sourcing $x |   # write-host write-host Sourcing $x | ||||||
|   Import-Module $x |   Import-Module $x | ||||||
| } | } | ||||||
|  |  | ||||||
|  | foreach ($x in Get-ChildItem *.ps1) { | ||||||
|  |   # write-host write-host Sourcing $x | ||||||
|  |   . $x | ||||||
|  | } | ||||||
| popd | popd | ||||||
|  |  | ||||||
| # Drop *.ps1 files into "$ENV:CMDER_USER_CONFIG\config\profile.d" | # Drop *.ps1 files into "$ENV:CMDER_USER_CONFIG\config\profile.d" | ||||||
| # to source them at startup.  Requires using cmder.exe /C [cmder_user_root_path] argument | # to source them at startup.  Requires using cmder.exe /C [cmder_user_root_path] argument | ||||||
| if ($ENV:CMDER_USER_CONFIG -ne "" -and (test-path "$ENV:CMDER_USER_CONFIG\profile.d")) { | if ($ENV:CMDER_USER_CONFIG -ne "" -and (test-path "$ENV:CMDER_USER_CONFIG\profile.d")) { | ||||||
|     pushd $ENV:CMDER_USER_CONFIG\profile.d |     pushd $ENV:CMDER_USER_CONFIG\profile.d | ||||||
|     foreach ($x in Get-ChildItem *.ps1) { |     foreach ($x in Get-ChildItem *.psm1) { | ||||||
|       # write-host write-host Sourcing $x |       # write-host write-host Sourcing $x | ||||||
|       Import-Module $x |       Import-Module $x | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     foreach ($x in Get-ChildItem *.ps1) { | ||||||
|  |       # write-host write-host Sourcing $x | ||||||
|  |       . $x | ||||||
|  |     } | ||||||
|     popd |     popd | ||||||
| } | } | ||||||
|      |      | ||||||
| @@ -153,7 +163,7 @@ if (test-path "$env:CMDER_ROOT\config\user-profile.ps1") { | |||||||
| $CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user_profile.ps1" | $CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user_profile.ps1" | ||||||
| if (Test-Path $CmderUserProfilePath) { | if (Test-Path $CmderUserProfilePath) { | ||||||
|     # Create this file and place your own command in there. |     # Create this file and place your own command in there. | ||||||
|     Import-Module "$CmderUserProfilePath" |     . "$CmderUserProfilePath" # user_profile.ps1 is not a module DO NOT USE import-module | ||||||
| } | } | ||||||
|  |  | ||||||
| if ($ENV:CMDER_USER_CONFIG) { | if ($ENV:CMDER_USER_CONFIG) { | ||||||
| @@ -166,7 +176,7 @@ if ($ENV:CMDER_USER_CONFIG) { | |||||||
|  |  | ||||||
|     $CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user_profile.ps1" |     $CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user_profile.ps1" | ||||||
|     if (Test-Path $CmderUserProfilePath) { |     if (Test-Path $CmderUserProfilePath) { | ||||||
|       Import-Module "$CmderUserProfilePath" |       . "$CmderUserProfilePath" # user_profile.ps1 is not a module DO NOT USE import-module | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user