The other day, I was trying to update my Domain Joined machine with Visual Studio 2017, however, one of the GPO on the Domain blocked VS from updating.
You also, get this error message when trying to use Visual Studio 2017 and Docker to debug applications.
After trying to change the PowerShell Execution Policy and continue with the update, I received the error below.
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 AllSigned. Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more information please see "Get-Help Set-ExecutionPolicy". At line:1 char:1 Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope.
Because it was Sunday and I couldn’t connect to the network and exclude my Laptop from the policy, I had to make a change to the registry and bypass the Domain GPO.
To change the PowerShell execution Policy using, Open Regedit and want to path below.
From the Powershell folder, I doubled clicked on ExecutionPolicy and changed the value to unrestricted
After the change, when I run Get-ExecutionPolicy I see the change an I can run the update.
Remember that this change will work only If you’re not connected to the Domain and have admins rights to the computer.
Once the computer Is connected to the Domain, GPOs will apply to the computer and change the policy.