powershelltshark

Powershell has a problem escaping double quotes in tshark


In cmd

tshark -r a.pcapng -Y "http.request.uri == \"/test.php\" || http.response"

There is an error when using Escape / in Powershell. I tried \ ` , but I couldn't get the command to work.

tshark -r 0.pcapng -Y "http.request.uri == `"\/test.php`" || http.response"
tshark: "`" was unexpected in this context.
    http.request.uri == `\/test.php` || http.response
                        ^

Solution

  • The equivalent of the following cmd.exe command line:

    :: cmd.exe (batch file)
    tshark -r a.pcapng -Y "http.request.uri == \"/test.php\" || http.response"
    

    is (applies analogously to all calls to external programs):

    See this answer for more information.