Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope!!!

You have reached to this blog post probably after hitting into the below issue on executing:

Set-ExecutionPolicy "RemoteSigned"

 

Error thrown may be as follows:

Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will retain its current effective execution policy of "Unrestricted". Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more information, please see "Get-Help Set-ExecutionPolicy.

"Set-ExecutionPolicy" cmdlet is used for changing the user preference for the Windows PowerShell execution policy. details can be found here.

If the current logged-in user is an administrator on the system with proper access but still getting the above issue, following blogpost instruction may be helpful in re-setting group policy.

However, if the issue persists and "Get-ExecutionPolicy -List" command shows something similar as shown below:

    MachinePolicy = RemoteSigned
    UserPolicy       = Undefined
    CurrentUser = Unrestricted
    LocalMachine  = RemoteSigned

Execute the below commands in powershell commandline as an administrator:

Set-ExecutionPolicy "RemoteSigned" -Scope Process -Confirm:$false

Set-ExecutionPolicy "RemoteSigned" -Scope CurrentUser -Confirm:$false

This will set the execution policy for the given scope.

On executing "Get-ExecutionPolicy -List", we should now see the below:

    MachinePolicy = RemoteSigned
    UserPolicy       = Undefined
    Process           = RemoteSigned
    CurrentUser     = RemoteSigned
    LocalMachine  = RemoteSigned