Nano Server Image Builder issue with Set-ExecutionPolicy
There is clearly an issue with the way "Nano Server Image Builder" detects and tries to set the execution policy when it has been set by GPO or other means. My GPO setting is "unrestricted", but both New-NanoServerImage PS cmdlet and the aforementioned GUI error: "Error: Set-ExecutionPolicy failed with System.Management.Automation.CmdletInvocationException: 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". ---> System.Security.SecurityException: Security error."
I now have to modify the GPO to remove the setting of "Unrestricted" so this tool / cmdlet can set it to unrestricted, which could have been avoided if you had used "bypass".
Caio Augusto Marchitiello Bauab commented
You need to sign the script and not to try decrease the security level!
Gene Morse commented
I'm having the same issue, please fix.
darrell tunnell commented
Hit this today. Fix please :-)