Skip to content

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

Open
@espenrl

Description

@espenrl

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)'\""
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions