-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed problem with Invoke-Expression #667
Conversation
@@ -74,7 +74,7 @@ $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 | |||
& $CmderUserProfilePath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's to just run the profile.ps1 into the current session you want to dot source it:
. "$CmderUserProfilePath"
Honestly I'm not sure what &
will do different but you'll see a lot of 'dot source' when looking at powershell examples so it would be more consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked it up, the difference between dot sourcing and the ampersand is that dot sourcing gives the command prompt access to the variables and functions defined in the script after execution, with an ampersand you can't access them from the command prompt.
Fixed problem with Invoke-Expression
AH so that was what @Jackbennett removed here 7ebfffc :D |
I wasn't sure what it was but powershell wouldn't run with it so out it came :) How'd that get in there I thought git would deal with all that. Are you writing PS in something that isn't the ISE? That complained about the character immediately. (Not using the ISE is perfectly fine by the way) |
A Microsoft made application, that doesn't support UTF-8? Colour me surprised. 😆 |
I have |
I actually use GitHub's Atom editor for almost anything |
Ever given brackets ago @Stanzilla ? I only ask because I made the jump from sublime to brackets. Atom came out about a year later and I just haven't considered switching. Only downside with not using the ISE is you're missing that sweet sweet intellisense |
I always wanted to but was too lazy to switch from Sublime, now Atom has most of the features I wanted to try Brackets for as plugins...Atom is still pretty new but community and devs are great and pushing really hard to get stuff done and I love that, so I'm stuck there for now :D |
I did those last few commits to martiuk-dev with vim... on my phone. Is that too far? I usually use vim on Linux or sublime text 3 on Qindows. |
Vim on your phone? Lol that's hardcore dude |
Invoke-Expression has a problem with spaces in path names(oops), this fixes that issue.
Also, the file or atleast the lambda needs to be encoded in UTF-8-BOM else it won't show properly.