1

EDIT eventually tested within the Fiddler Command Line Prompt, results are the same, this is not related to Powershell, but I keep the post as it is for context.


My issue: I am running a Powershell script to create an archive of my Fiddler Session.

$command_dump_fiddler = "`"C:\Users\[...]\AppData\Local\Programs\Fiddler\ExecAction.exe`" dump"
Invoke-Expression -Command "& $command_dump_fiddler";

I have slightly changed it to measure the execution:

$command_stop_fiddler = "`"C:\Users\[...]\AppData\Local\Programs\Fiddler\ExecAction.exe`" quit"
$command_dump_fiddler = "`"C:\Users\[...]\AppData\Local\Programs\Fiddler\ExecAction.exe`" dump"
Measure-Command { Invoke-Expression -Command "& $command_dump_fiddler"; Invoke-Expression -Command "& $command_stop_fiddler"; Wait-Process -Name "Fiddler" -ErrorAction Ignore }

What brought me here: my Fiddler logs have gotten heavier than before, but execution time seems to have even more increased compared to how my logs size have increased.

Now, I have done some testing and realised that dump command is not linear. Here's an example with a .saz file of 150Kb with 17000 IDs:

Dump Command takes 1 minute and 40 seconds

Now if I open it twice, so I just have twice the same data (300Kb and 34000 IDs)

Dump Command takes 5 minutes

My question: Why? .saz is supposed to be an archive, having the same data twice should not take more than twice the time of the single data. Perhaps there is some settings I am missing?

Many thanks in advance

vvilin
  • 185
  • 10
  • As an aside: [`Invoke-Expression` should generally be avoided](https://blogs.msdn.microsoft.com/powershell/2011/06/03/invoke-expression-considered-harmful/); definitely [don't use it to invoke an external program](https://stackoverflow.com/a/57966347/45375). – mklement0 Nov 15 '19 at 21:47
  • Where does the `dump` sub-command dump its data? – mklement0 Nov 15 '19 at 21:51
  • In this directory: `C:\Users\[...]\Documents\Fiddler2\Captures` under the name `dump.saz`. – vvilin Nov 15 '19 at 21:53
  • This means that PowerShell is really incidental to your question - what matters is `ExecAction.exe`'s behavior. I do suggest, however, invoking the executable _directly_ from PowerShell: `& "C:\Users\[...]\AppData\Local\Programs\Fiddler\ExecAction.exe" dump` – mklement0 Nov 15 '19 at 21:57
  • I will try this and compare the results. Thanks – vvilin Nov 15 '19 at 22:08
  • Eventually, this does not change the speed.. it takes exactly the same time, I also tried by typing the `dump` command within "Fiddler Command Line" Prompt, and we obtain the same results.. Does not look like it has something to do with Powershell – vvilin Nov 15 '19 at 22:22
  • That makes sense - I've removed the PowerShell tag. – mklement0 Nov 15 '19 at 22:23

0 Answers0