Monthly Archive

Categories

Get-ExecutionPolicy

I’ve used Get-ExecutionPolicy since PowerShell v1 and never stopped to think about it. The cmdlet normally returns just the current policy

PS> Get-ExecutionPolicy
RemoteSigned

 

However, if you dig a little deeper

PS> Get-ExecutionPolicy -List

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

 

What you’re seeing is the LocalMachine policy.

 

You can use the Scope parameter on Set-ExecutionPolicy to create a more granular approach to execution policy if required

Comments are closed.