<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58689>58689</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            executing a powershell script (the runs clang-tidy) from Visual Studio causes this stack dump
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jason-m-reich
      </td>
    </tr>
</table>

<pre>
    The script I'm running is run_clang_tidy.ps1 which has this line:
`clang-tidy *.cpp src/*.cpp src/*.h`

When I run it from Windows Terminal (so not within Visual Studio) everything works. I just do `& .\run_clang_tidy.ps1` from the root of my C++ project and get the expected output.

But when I run `& .\run_clang_tidy.ps1` form the Visual Studio [Developer PowerShell] terminal, I get this:

```
➜ & .\run_clang_tidy.ps1
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\Llvm\\bin\\clang-tidy.exe" *.cpp src/*.cpp src/*.h
#0 0x01b05280 C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\bin\clang-tidy.exe 0xdf5280
```

If I run a simply hello world .ps1 file from the same Visual Studio terminal everything behaves as expected.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVNluozAU_Rp4uSoiDmTCAw9t2kqVOlKlVp3HkcEG3BobeWmav59rQyZdZtMgy-vF5xzfpdHsUD8MHGxrxOTgJiFfRjBeKaF6EDZMv7eSqv67E-yQTXYF-0G0AwzUghvQQgrFk_V5kl8m-XmyyaP1WbCGhJxn7TSBNW1Crj-vBjRf_ov9t4EruAmYIBx0Ro_wTSim9xYeuBmFohLv3FoNSjvYC8RX8Cisx_1755nQCamAv3BzCEc97LV5thle-eStA6YhAJINZEm5-6wMD2dQhw9iNELoDsYD7BJygQ0mo59464AqBj130Yy_TrjFGWjvJu-yt3IuPJI8Sfo7tjYz9jtJkJQXl6hJ6okbuNN7bu4HLmVSXoJbXiUhOwSZOQl78sbRJ0ubl1ckqa6Sagd_YBMt726vzu-vwPpmRHdQaHwPhk_aIIyGwbkpQgVfXvfoDN9krR5xIeXLcThbHg2XwlrPLU7iAwrVSs941NsaagdoaPvsDG358oj3DjeA-XH6KSjPIH53RveGjkBN70euXOCBcsguWJY7bEeLayERM259Fa3RVnfuQ8jEQ5ITMs92ehy9Eu4wLx938_igtVwuug3y4qwRap6cgj7jrxyZ_EPsz94g6xzy13zV5CXZ5rAo-Ej_99wX4m9ZP77lu5Cdmb6nibisC6i_jpPY33RL9FKwYpzkAULs6ZBZkkGsBx1yPOWNpePHAD5G6dvMbPhAX7gFrCLHFMpSXq82my-rvCw2RcrqNavWFU2dcJLXyLf1LvxKYQpJYAORY93CqhCT1isLJ5GhGkRi7_m01Fu-VC_7M8hSb2T9_0FdbjfbKh1qxgkvNquuCz1n22JDWVkRVMXouiBFKmnDpa0xqzGDU1EHB67ydZ4X5SovMt4x3rYFLUm1Lar1KilyPlIhswCcadOnpo4cMBstHkphnT0dUmtFrzg_3k-9G7Spn6jV6mw8MxxrdxpJ15HxDygm6zI">