PowerShell 7 not detected

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • 1.17.0
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      OS: Windows
      node.js / npm versions:
      Additional info:
    • 1
    • Not Needed
    • Developer Tools

      Problem Statement/Rationale

      launchMongoShell.ts matches the literal string `powershell.exe`. PowerShell 7 installs as `pwsh.exe`, so it matches nothing and $MDB_CONNECTION_STRING is parsed as an ordinary PowerShell variable that was never set, which expands to empty with no error. As a result, the user silently connects to localhost instead of the cluster they selected.

      Steps to Reproduce

      1. Windows, `terminal.integrated.defaultProfile.windows` set to PowerShell 7 (pwsh)
      2. Connect to any remote cluster
      3. Launch MongoDB Shell

      Expected Results

      mongosh connects to the selected cluster.

      Actual Results

      mongosh starts against localhost.

            Assignee:
            Rhys Howell
            Reporter:
            Alena Khineika
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: