1

I am running a command (part of Chromium DevTools) which requires a double dash. Powershell (pwsh 7) seems to have trouble parsing the double dash:

$ "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --custom-devtools-frontend=file://C:\Users\mikem\Code\devtools\devtools-frontend\out\Default\resources\inspector
ParserError:
Line |
   1 | "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --custom-devtools-frontend=file://C:\Users\mikem\Code\devtools\devtools-frontend\out\Default\resources\inspector
     |                                                                  ^ Unexpected token
     | 'custom-devtools-frontend=file://C:\Users\mikem\Code\devtools\devtools-frontend\out\Default\resources\inspector'
     | in expression or statement.

How can I run the command, more specifically, how can I make pwsh handle double dashes?

mikemaccana
  • 110,530
  • 99
  • 389
  • 494
  • 1
    Use `& "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --custom-devtools-frontend=...` (Notice the `&` call operator in front) – Mathias R. Jessen Feb 10 '20 at 10:20
  • 1
    This is a common question. You can also add that folder to the path, or backquote the spaces and not quote the whole thing. – js2010 Feb 10 '20 at 12:49
  • The [linked post](https://stackoverflow.com/a/57678081/45375) explains why `&`, the call operator, is needed in this situation. – mklement0 Feb 10 '20 at 13:36

0 Answers0