cmder icon indicating copy to clipboard operation
cmder copied to clipboard

powershell read user profile

Open harkx opened this issue 11 years ago • 8 comments

Using 150513 it seems cmder does not use the Powershell profile. I have a function in that profile to connect to Ofice365, it would be great if launching cmder reads the powershell proflile.

In my case it's located in:

C:\Users\me\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

You can query this location in Powershell with this command:

$Profile

harkx avatar May 25 '15 15:05 harkx

Go to settings > startup > tasks and remove the --NoProfile from the PowerShell command arguments.

strig avatar Jun 13 '15 00:06 strig

Perfect! Thanks!

harkx avatar Jun 13 '15 06:06 harkx

@strig why is this not default?

nevion avatar Oct 14 '15 17:10 nevion

I guess one could argue that to keep cmder properly portable it should ignore the local PS profile, not sure though

Stanzilla avatar Oct 14 '15 18:10 Stanzilla

Would it be a nice compromise to add someting like this into user_profile.ps:

# cmder runs the powershell with '--NoProfile', so $Profile isn't called on startup.
# If you want to use your $Profile, you can either uncomment the next lines or 
# change the startup to use $Profile (in cmder under settings > startup > tasks -> 
# remove the '--NoProfile' from the PowerShell command arguments).
#if (Test-Path $PROFILE) {
#    . $PROFILE
#} 

jankatins avatar Oct 15 '15 09:10 jankatins

What about a separate pre-configured task that doesn't have --noProfile. People can test with it and just move the default over if they choose.

Jackbennett avatar Oct 15 '15 15:10 Jackbennett

I was very puzzled why running PowerShell from the Start menu behaved differently from running it in Cmder. This cost me some time and effort to research the issue. Please fix. Thank you.

LexVocoder avatar Oct 24 '18 22:10 LexVocoder

@AlexHankins Add to the %cmder_root%\user_profile.ps1:

. $profile

daxgames avatar Oct 25 '18 13:10 daxgames