Beginning in PowerShell 6.0 for non-Windows computers, the default execution policy is Unrestricted and can't be changed. Open the Local Group Policy Editor and navigate to Computer Configuration-> Administrative Templates-> Windows Components-> Windows PowerShell. If you can get your GPO to run the script with the following syntax: "Powershell.exe <path>\<script>.ps1", you can add the -ExecutionPolicy Bypass statement (Powershell.exe -ExecutionPolicy Bypass <path>\<script>.ps1) and run just this one script unrestricted while maintaining the execution policy. Powershell execution policy setting is overridden by a policy defined at a more specific scope. Open the setting in the right window pane, open the Turn on Script Execution setting. Windows PowerShell ExecutionPolicy let you determine the conditions under which Windows PowerShell loads configuration files and runs scripts.
Get-ExecutionPolicy (Microsoft.PowerShell.Security) - PowerShell Configure PowerShell Execution policy in Active Directory When this mode is set and you try to run the script, you will get the .
Bypassing Execution Policy for SCCM Server for Powershell Detection Method Double-click a setting called "Turn on Script Execution" on the right pane.
Configuring PowerShell Execution Policy with Group Policy - Lessons ... Right-click "Turn on script execution", then select "Edit". If they are downloaded from the internet, you may need to execute unblock-file on them before running them. It's located in SCCM Console -> Administration -> Client Settings -> <Name of your Client Settings> -> Computer Agent -> Powershell execution policy and set it to bypass. The Update-Help cmdlet downloads and installs the newest help files for PowerShell modules and installs them on the computer. Typical PowerShell output with unnecessary and inconsequential error If a GPO sets the execution policy, the command line is not allowed to change that setting. This is equivalent to the Restricted execution policy. Select the Enabled option. You can see what options exist for this policy setting in the screenshot below. You can actually change the MachinePolcy Execution Policy without going through GPO! No warnings, no prompts. For more information, see about_Execution_Policies.
about Group Policy Settings - PowerShell | Microsoft Docs about Execution Policies - PowerShell | Microsoft Docs