PowerShell / PowerShellStandard

MIT License
158 stars 24 forks source link

dotnet new template psmodule - launchSettings.json / debug profiles #47

Open espenrl opened 6 years ago

espenrl commented 6 years ago

In .NET automation libraries I find these profiles convenient for debugging. Maybe others might find them useful.

Only works for Visual Studio though. A drawback is hard coded paths to PowerShell Core executables.

{
  "profiles": {
    "PowerShell Core x64": {
      "commandName": "Executable",
      "executablePath": "C:\\Program Files\\PowerShell\\6.0.1\\pwsh.exe",
      "commandLineArgs": "-NoExit -Command \"Import-Module '$(TargetPath)'\""
    },
    "PowerShell Core x86": {
      "commandName": "Executable",
      "executablePath": "C:\\Program Files (x86)\\PowerShell\\6.0.1\\pwsh.exe",
      "commandLineArgs": "-NoExit -Command \"Import-Module '$(TargetPath)'\""
    },
    "PowerShell Desktop x64": {
      "commandName": "Executable",
      "executablePath": "%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe",
      "commandLineArgs": "-NoExit -ExecutionPolicy ByPass -Command \"Import-Module '$(TargetPath)'\""
    },
    "PowerShell Desktop x86": {
      "commandName": "Executable",
      "executablePath": "%SystemRoot%\\syswow64\\WindowsPowerShell\\v1.0\\powershell.exe",
      "commandLineArgs": "-NoExit -ExecutionPolicy ByPass -Command \"Import-Module '$(TargetPath)'\""
    }
  }
}
TylerLeonhardt commented 6 years ago

I think it would be nice to have something like this - but I also want it to be generic enough. Also, not everyone uses Visual Studio so we'd want some switch to specify what text editor you're looking to use.

If I want Visual Studio, I get this. If I want VSCode, I should get a launch.json.. etc.

sandersaares commented 5 years ago

If I want Visual Studio, I get this. If I want VSCode, I should get a launch.json.. etc.

How about just including the launch config for all the supported editors?

TylerLeonhardt commented 5 years ago

We could also do that! I know that repos tend to include config files for multiple editors.