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”).
- Ctrl + Shift + p and type “settings.json”
- Copy&Paste code
- 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.