Visual studio code cmd error: Cannot be loaded because running scripts is disabled on this system

后端 未结 11 1496
北荒
北荒 2020-12-02 07:52

Inside of visual studio code, I\'m trying to execute a script.bat from the command line, but I\'m getting the following error:

File C:\\Theses_Repo\\t

11条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 08:24

    1. Open VS code

    2. File -> Prefrences -> settings

    3. in the Search bar -> Search for "terminal.integrated.shellArgs"

    4. Click on the "Edit in setting.json" for Terminal>integrated>ShellArgs > windows [whatever you OS, select the respective settings]

    5. At the top of the json file add this :

      terminal.integrated.shellArgs.windows": ["-ExecutionPolicy", "Bypass"]

      For example after adding your json might look like:

    {
        "terminal.integrated.shellArgs.windows": ["-ExecutionPolicy", "Bypass"],
        "git.autofetch": true,
        "peacock.favoriteColors": [
            {
                "name": "Angular Red",
                "value": "#b52e31"
            },
            {
                "name": "Auth0 Orange",
                "value": "#eb5424"
            },
    
    1. restart the VS code and try the command again (in my case i was trying ng serve)

提交回复
热议问题