mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-11-04 11:22:13 +08:00 
			
		
		
		
	Merge pull request #666 from Pireax/posh-user-script
Add user startup file for powershell
This commit is contained in:
		
							
								
								
									
										10
									
								
								vendor/profile.ps1
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								vendor/profile.ps1
									
									
									
									
										vendored
									
									
								
							@@ -63,3 +63,13 @@ if (Test-Path Env:\CMDER_START) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Enhance Path
 | 
					# Enhance Path
 | 
				
			||||||
$env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT"
 | 
					$env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config/user-profile.ps1"
 | 
				
			||||||
 | 
					if(Test-Path $CmderUserProfilePath) {
 | 
				
			||||||
 | 
					    # Create this file and place your own command in there.
 | 
				
			||||||
 | 
					    Invoke-Expression $CmderUserProfilePath
 | 
				
			||||||
 | 
					} else {
 | 
				
			||||||
 | 
					    Write-Host "Creating user startup file: $CmderUserProfilePath"
 | 
				
			||||||
 | 
					    "# Use this file to run your own startup commands" | Out-File $CmderUserProfilePath
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user