Check Execution Policy

Read more About Execution Policies
All PowerShell execution policies:
  • Restricted – No scripts can be run. Windows PowerShell can be used only in interactive mode.
  • AllSigned – Only scripts that are signed by a trusted publisher can be run.
  • RemoteSigned – Downloaded scripts must be signed by a trusted publisher before they can be run.
  • Unrestricted – No restrictions; all Windows PowerShell scripts can be run.

The “Get-ExecutionPolicy” cmdlet shows the current PowerShell execution policy.

The “Set-ExecutionPolicy” cmdlet changes the PowerShell execution policy.

Example –

  • By default in my windows 10 client machine. Scope of execution policy was set to Undefined. I used Get-ExecutionPolicy -List command
  • By using Set-ExecutionPolicy -ExecutionPolicy RemoteSigned command and it changed LocalMachine scope to RemoteSigned.
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s