Coder Social home page Coder Social logo

Comments (12)

ThePSAdmin avatar ThePSAdmin commented on May 18, 2024

There is an example powershell folder in the respository, and it looks like this:

{
    "version": "0.1.0",
    "configurations": [
        {
            "name": "PowerShell",
            "type": "PowerShell",
            "program": "DebugTest.ps1"
        }
    ]
}

You need to change the program to the name of the script that you want to run. I made the mistake of just writing the function name, but just got it to work with the actual file name.

from vscode-powershell.

daviwil avatar daviwil commented on May 18, 2024

Thanks @ThePSAdmin! Yes, there isn't a default configuration provided. This is a little confusing, I'll see if I can get something in there by default.

from vscode-powershell.

mattmcnabb avatar mattmcnabb commented on May 18, 2024

Thanks PSAdmin!

from vscode-powershell.

kavaliro avatar kavaliro commented on May 18, 2024

If I go into a directory and launch the debugger, and there's not a launch.config, I would expect a prompt to create one (this exists) that is pre-populated with the values needed to run the script I am currently viewing (this does not.)

And thanks guys; this plug-in is great stuff!

from vscode-powershell.

daviwil avatar daviwil commented on May 18, 2024

Hey James, this will be added in a future release. The VS Code team told me what I need to do to make it happen.

from vscode-powershell.

artisticcheese avatar artisticcheese commented on May 18, 2024

Is this issue fixed? I'm still seeing the same problem with latest VSCode and Powershell Extension.
VSCode 0.10.10

from vscode-powershell.

daviwil avatar daviwil commented on May 18, 2024

Yep, it's been fixed for a long time. Can you tell me the sequence of steps you take and what you observe?

from vscode-powershell.

artisticcheese avatar artisticcheese commented on May 18, 2024

Here is problems steps recorder what is happening

from vscode-powershell.

daviwil avatar daviwil commented on May 18, 2024

Thanks! That was helpful. I'm pretty sure Visual Studio Code does not allow you to debug a single opened file. You'll need to open the folder that this file is contained in using File -> Open Folder before the debugger will be able to generate a launch.json for your project.

from vscode-powershell.

artisticcheese avatar artisticcheese commented on May 18, 2024

Not sure what I'm doing wrong but the same thing happens when I open folder.

from vscode-powershell.

daviwil avatar daviwil commented on May 18, 2024

Now you've got a launch.json file, click the green debug 'start' button again :) VS Code has to generate the default launch.json first as a one-time step when one doesn't exist. Now that you have one, your script will be able to run.

from vscode-powershell.

artisticcheese avatar artisticcheese commented on May 18, 2024

Thanks, that did it

from vscode-powershell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.