Here is a sample of the commands I am running:

PS C:\> Get-ExecutionPolicy -List 

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser       Undefined
 LocalMachine    Unrestricted


PS C:\> Set-ExecutionPolicy Unrestricted -Scope CurrentUser
PS C:\> Get-ExecutionPolicy -List

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser       Undefined
 LocalMachine    Unrestricted

I want to set the CurrentUser to Unrestricted, but I can't seem to do so. I checked for group policies in place as outlined in this MSDN document, but didn't find anything that was configured.

Any clue as to how I can set this?

  • I am not able to reproduce this. It works as intended on my machine. Are you getting any errors? – briantist Jun 4 '15 at 16:54
  • @briantist It's a Windows 10 bug. – CamronBute Jun 4 '15 at 17:35

Like all the others have said this seems to be a bug in preview build of Windows 10. I got it to work by simply providing the -Force parameter.

Setting for Local Machine:

Set-ExecutionPolicy RemoteSigned -Force

Setting for Current User:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

up vote 3 down vote accepted

This seems to be a bug in Windows 10. I had to create the key HKEY_CURRENT_USER\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell and create a string value in that key called ExecutionPolicy with the data Unrestricted before it would work. Even then, I can't seem to change it without modifying the registry.

I do not see the bug in my installation of Windows 10. I simply went through the installation using VMWare Workstation 11 and built out a VM. I ran the following without making any changes prior to it:

enter image description here

In case you want to know the Version of Windows 10 I have: 10.0.10074

  • 2
    I see the unexpected behavior described by OP. Windows 10 Enterprise build 10130. – jscott Jun 5 '15 at 1:08
  • If that is the case then you should submit the bug through Connect or see if it has already. – Shawn Melton Jun 5 '15 at 2:17

I had a more generalized powershell policy issue than the OP had, but a combination of answers found here and elsewhere ended up being needed for my Win10 Anniversary Edition to correctly update its policies:

1) Make sure this registry entry exists and is set to the lowest security level that you want to allow: HKEY_CURRENT_USER\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell
Name:ExecutionPolicy Type: REG_SZ Data:Unrestricted
2) Make sure this registry entry exists and is set to the lowest security level you want to allow: HKLM:\Software\Policies\Microsoft\Windows\PowerShell
Name:ExecutionPolicy Type: REG_SZ Data: Unrestricted
3) Update your Group Policy by running gpedit.msc and navigate to Computer Configuration > Administrative Templates > Windows Components > Windows PowerShell
Select Turn on Script Execution, then Edit policy setting with Enabled and in the box below it that says Execution Policy, set it to Allow All Scripts

After you've done all that nonsense, you can use ddcruver's answer by force-updating your policies, depending on what you want. If you set your policies to Unrestricted, I would advise setting all the settings that populate from Get-ExecutionPolicy -List to something more restrictive, like RemoteSigned, as malicious powershell scripts are one of the leading causes of memory-based Windows malware.

You must run powershell with elevated mode before change execution policy

I found that the Registry Key located at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell 

was set to RemoteSigned. Setting the value to Unrestricted has worked for me.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.