{"id":4742,"date":"2018-04-06T23:32:10","date_gmt":"2018-04-06T23:32:10","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=4742"},"modified":"2018-04-06T23:32:10","modified_gmt":"2018-04-06T23:32:10","slug":"a-quick-note-about-psexecutionpolicypreference","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2018\/04\/06\/a-quick-note-about-psexecutionpolicypreference\/","title":{"rendered":"A quick note about PSExecutionPolicyPreference"},"content":{"rendered":"<p>Running powershell scripts on the system is typically restricted so the usual way to bypass it is to:<\/p>\n<ul>\n<li>run <em>powershell -ep &lt;policy&gt;<\/em> and its variants<\/li>\n<li>use <em>Set-ExecutionPolicy &lt;policy&gt;<\/em> after launching powershell.exe<\/li>\n<\/ul>\n<p>There is also one more option &#8211; use an environment variable called PSExecutionPolicyPreference.<\/p>\n<p>See screenshot:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/04\/powershell_PSExecutionPolicyPreference.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4743\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/04\/powershell_PSExecutionPolicyPreference.png\" alt=\"\" width=\"500\" height=\"199\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/04\/powershell_PSExecutionPolicyPreference.png 942w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/04\/powershell_PSExecutionPolicyPreference-300x119.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/04\/powershell_PSExecutionPolicyPreference-768x305.png 768w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Running powershell scripts on the system is typically restricted so the usual way to bypass it is to: run powershell -ep &lt;policy&gt; and its variants use Set-ExecutionPolicy &lt;policy&gt; after launching powershell.exe There is also one more option &#8211; use an &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2018\/04\/06\/a-quick-note-about-psexecutionpolicypreference\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[60],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/4742"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=4742"}],"version-history":[{"count":1,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/4742\/revisions"}],"predecessor-version":[{"id":4744,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/4742\/revisions\/4744"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=4742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=4742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=4742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}