VSCode – Execution policies

Table of Contents

Instructions

The issue is that PowerShell by default restricts running scripts unless we change the execution policies.

we can change the execution policies by adding -ExecutionPolicy Bypass args. in vscode you will have to create a shell profile with these args by adding below in settings.json (ctrl + shift + p and type “settings.json”).

  1. Ctrl + Shift + p and type “settings.json”
  2. Copy&Paste code
  3. Restart VSCode
				
					"terminal.integrated.profiles.windows": {
  "PowerShell": {
    "source": "PowerShell",
    "icon": "terminal-powershell",
    "args": ["-ExecutionPolicy", "Bypass"]
  }
},
"terminal.integrated.defaultProfile.windows": "PowerShell",
				
			

Note: terminal.integrated.shellArgs settings have been deprecated.