brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Get-ExecutionPolicy -List shows which Windows scope blocks your script

Windows
~/tips/tip-windows-get-executionpolicy-list

Get-ExecutionPolicy -List

Find the PowerShell scope whose policy wins, before changing anything.

Changed the execution policy and PowerShell still acts the same? The policy can be set in five places, and only one of them wins.

My first move is to look at all of them, listed in order of precedence:

Get-ExecutionPolicy -List

You get a small table like this:

        Scope ExecutionPolicy
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser    RemoteSigned
 LocalMachine       AllSigned

Read it from the top. The first row that isn’t Undefined is the one in force, so here it’s RemoteSigned from CurrentUser, whatever LocalMachine says. If every row is Undefined, a Windows client falls back to Restricted and runs no scripts.

To allow your own local scripts for your account only, without admin rights:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

The two policy rows at the top come from Group Policy. You can’t override them with Set-ExecutionPolicy, and on a work PC that’s a question for whoever manages it. Microsoft is also clear that the execution policy is a guard against accidents. It isn’t a security boundary, so don’t treat a strict setting as protection from a determined person.

Further reading: about_Execution_Policies

More Windows tips Win+Ctrl+C Win+Shift+Left arrow Win+Ctrl+Left arrow Alt+PrtScn Left Alt + Left Shift + Print Screen All Windows tips (33) All topics

Link