Skip to content
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

Add Powershell init script with prompt style and welcome message #33

Closed
wants to merge 2 commits into from
Closed

Add Powershell init script with prompt style and welcome message #33

wants to merge 2 commits into from

Conversation

Shoozza
Copy link
Contributor

@Shoozza Shoozza commented Nov 27, 2013

No description provided.

@samvasko
Copy link
Contributor

That is a very good idea but...

File C:\Users\Samuel\Desktop\Cmder\repo\vendor\init.ps1 cannot be loaded because running scripts is disabled
on this system. For more information, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
    + CategoryInfo          : SecurityError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnauthorizedAccess

What do you suggest?

@Jackbennett
Copy link
Contributor

The execution policy get-executionPolicy -List is something you've go to set yourself to unrestricted for random scripts from the internet to run. Personally I think best thing you can do is explain it in an FAQ and accept it's just going to be a blocker to using powershell by default (sadly).

Setting the policy to remoteSigned is what a user of powershell will(should) be running with, they'd have to cd cmder project folder and run ls *.ps1 -recurse | unblock-file to release the scripts. The policy unrestricted would not require this. That's why package managers seem to say to that in step one.

see: get-help unblock-file -ShowWindow
see: ls *.ps1 -recurse | unblock-file -Whatif

I could go on but I fear I'm already coming off as patronising.

@samvasko
Copy link
Contributor

Thanks for a great explanation... Can you possibly use -ExecutionPolicy flag to just shim that for the init script and then return it back to normal on the end?

@austinwagner
Copy link
Contributor

Couldn't @Bliker just sign the script to prevent needing to set the execution policy to anything lower than AllSigned?

@samvasko
Copy link
Contributor

@austinwagner I am powerless as you are. You need a certificate that I am not planning to buy :(.
Or is that some other case in this situation?
(btw I just finished my traveling so brace yourself for round of updates)

@austinwagner
Copy link
Contributor

You should be able to generate a cert yourself. It won't be trusted by default since it's not from a CA, but the user will be prompted when the script is run if they want to allow it along with an option to always trust it.

@samvasko
Copy link
Contributor

samvasko commented Feb 5, 2014

I m merging this one into #136
Lets solve this powershell conundrum 💪

@samvasko samvasko closed this Feb 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants