Skip to content

Cannot start powershell 6 in debug on vscode #1703

@LazerFX

Description

@LazerFX

Trying to run pwsh.exe as a debug environment does not work in vscode. The terminal starts, but appears to disconnect from the environment immediately. Looking at the logs, I see:

1/18/2019 11:10:56 AM [NORMAL] - Language server starting --
1/18/2019 11:10:56 AM [NORMAL] -     exe: C:\Program Files\PowerShell\6\pwsh.exe
1/18/2019 11:10:56 AM [NORMAL] -     args: C:\Users\pstreet\.vscode\extensions\ms-vscode.powershell-1.10.2\modules\PowerShellEditorServices\Start-EditorServices.ps1 -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.10.2' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\pstreet\.vscode\extensions\ms-vscode.powershell-1.10.2\modules' -EnableConsoleRepl -LogLevel 'Normal' -DebugServiceOnly -LogPath 'C:\Users\pstreet\.vscode\extensions\ms-vscode.powershell-1.10.2\logs\1547804527-4208a79f-0b41-47bb-a104-75bf366ab1ec1547804506522\DebugSession-1.log' -SessionDetailsPath 'C:\Users\pstreet\.vscode\extensions\ms-vscode.powershell-1.10.2\sessions\PSES-VSCode-14592-Debug' -FeatureFlags @()
1/18/2019 11:10:57 AM [NORMAL] - powershell.exe started, pid: 28196
1/18/2019 11:11:00 AM [NORMAL] - powershell.exe terminated or terminal UI was closed

Attempting to run the command manually, I get the following output:

PS C:\WINDOWS\system32> & 'C:\Program Files\PowerShell\6\pwsh.exe' C:\Users\pstreet\.vscode\extensions\ms-vscode.powershell-1.10.2\modules\PowerShellEditorServices\Start-EditorServices.ps1 -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '1.10.2' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\pstreet\.vscode\extensions\ms-vscode.powershell-1.10.2\modules' -EnableConsoleRepl -LogLevel 'Normal' -DebugServiceOnly -LogPath 'C:\Users\pstreet\.vscode\extensions\ms-vscode.powershell-1.10.2\logs\1547804527-4208a79f-0b41-47bb-a104-75bf366ab1ec1547804506522\DebugSession-1.log' -SessionDetailsPath 'C:\Users\pstreet\.vscode\extensions\ms-vscode.powershell-1.10.2\sessions\PSES-VSCode-14592-Debug' -FeatureFlags @()
C:\Users\pstreet\.vscode\extensions\ms-vscode.powershell-1.10.2\modules\PowerShellEditorServices\Start-EditorServices.ps1 : Missing an argument for parameter 'FeatureFlags'. Specify a parameter of type 'System.String[]' and try again.
+ CategoryInfo          : InvalidArgument: (:) [Start-EditorServices.ps1], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingArgument,Start-EditorServices.ps1

PS C:\WINDOWS\system32>

This also fails if I use powershell.exe as the source, that also wants a string rather than an array.

Once I remove the -FeatureFlags @() section of the command, I get a comman line with PowerShell Integrated Terminal that apparently does nothing (I suspect because it's told to receive and pipe its output externally).

Versions:

VSCode version: 1.30.2 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8 x64

VSCode extensions:

AureliaEffect.aurelia@1.0.3
ban.spellright@3.0.22
codezombiech.gitignore@0.6.0
DavidAnson.vscode-markdownlint@0.23.0
DotJoshJohnson.xml@2.4.0
eamodio.gitlens@9.4.1
eg2.tslint@1.0.42
eg2.vscode-npm-script@0.3.5
fernandoescolar.vscode-solution-explorer@0.3.1
formulahendry.dotnet-test-explorer@0.6.0
GitHub.vscode-pull-request-github@0.3.2
heaths.vscode-guid@1.4.0
HookyQR.beautify@1.4.7
jesschadwick.nuget-reverse-package-search@0.1.68
jmrog.vscode-nuget-package-manager@1.1.6
k--kato.docomment@0.1.2
mauve.terraform@1.3.7
ms-azure-devops.azure-pipelines@1.147.1
ms-kubernetes-tools.vscode-kubernetes-tools@0.1.15
ms-vscode.azurecli@0.4.2
ms-vscode.csharp@1.17.1
ms-vscode.PowerShell@1.10.2
ms-vsliveshare.vsliveshare@0.3.1121
ms-vsliveshare.vsliveshare-audio@0.1.48
ms-vsts.team@1.144.1
octref.vetur@0.14.5
oderwat.indent-rainbow@7.2.4
PeterJausovec.vscode-docker@0.5.1
redhat.vscode-yaml@0.2.1
technosophos.vscode-helm@0.4.0

PSES version: 1.10.2.0

PowerShell version:

Name Value


PSVersion 6.1.0
PSEdition Core
GitCommitId 6.1.0
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Modified settings (User):

{
    "breadcrumbs.enabled": true,
    "csharp.suppressHiddenDiagnostics": false,
    "docker.attachShellCommand.linuxContainer": "/bin/bash",
    "editor.fontFamily": "fira code retina medium",
    "editor.fontLigatures": true,
    "editor.renderControlCharacters": true,
    "editor.renderWhitespace": "all",
    "git.autofetch": true,
    "git.confirmSync": false,
    "git.enableSmartCommit": true,
    "git.fetchOnPull": true,
    "gitlens.heatmap.toggleMode": "window",
    "powershell.debugging.createTemporaryIntegratedConsole": true,
    "powershell.powerShellExePath": "C:\\Program Files\\PowerShell\\6\\pwsh.exe",
    "team.showWelcomeMessage": false,
    "terminal.integrated.shell.windows": "c:\\Program Files\\PowerShell\\6\\pwsh.exe",
    "vs-kubernetes": {
        "vs-kubernetes.minikube-path": "N:\\.vs-kubernetes\\tools\\minikube\\windows-amd64\\minikube.exe"
    },
    "window.zoomLevel": 0,
    "workbench.colorTheme": "Aurelia Dark+",
    "workbench.colorCustomizations": {
        "activityBarBadge.background": "#C6FF00",
        "list.activeSelectionForeground": "#C6FF00",
        "list.inactiveSelectionForeground": "#C6FF00",
        "list.highlightForeground": "#C6FF00",
        "scrollbarSlider.activeBackground": "#C6FF0050",
        "editorSuggestWidget.highlightForeground": "#C6FF00",
        "textLink.foreground": "#C6FF00",
        "progressBar.background": "#C6FF00",
        "pickerGroup.foreground": "#C6FF00",
        "tab.activeBorder": "#C6FF00",
        "notificationLink.foreground": "#C6FF00",
        "editorWidget.resizeBorder": "#C6FF00",
        "editorWidget.border": "#C6FF00",
        "settings.modifiedItemIndicator": "#C6FF00",
        "settings.headerForeground": "#C6FF00",
        "panelTitle.activeBorder": "#C6FF00",
        "breadcrumb.activeSelectionForeground": "#C6FF00",
        "menu.selectionForeground": "#C6FF00",
        "menubar.selectionForeground": "#C6FF00"
    }
}

Modified Settings (Folder):

{
    "powershell.codeFormatting.preset": "OTBS"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions