Andrey Bushman
Andrey Bushman

Reputation: 12516

How to set the execution policy for the powershell_ise when it is launching?

PowerShell 4.0

It is possible to set the execution policy for the process scope when the powershell host is launching. For example:

powershell -executionpolicy bypass

I want to do the same for powershell_ise host, but it hasn't the ExecutionPolicy key. Is exist the similar method of the execution policy setting for that host (maybe through the other way instead of keys)?

P.S. Of course, I can type this cmdlet manually, when powershell_ise will be launched, but I would want to create the separate label on my desktop for launching powershell_ise with this setting when I need it.

Upvotes: 0

Views: 1625

Answers (2)

Ahmed Omar
Ahmed Omar

Reputation: 1

Help is needed to set all of the ExecutionPolicies to "Restrictedenter image description here

Upvotes: 0

Ansgar Wiechers
Ansgar Wiechers

Reputation: 200483

Process scope execution policy is controlled by the PSExecutionPolicyPreference environment variable. You can set this environment variable to desired value before starting PowerShell ISE.

Upvotes: 1

Related Questions