首页 > 解决方案 > 在不修改 Fiddler 规则的情况下转储 fiddler 上的会话

问题描述

我想做这件事:

另外,我想在不修改 Fiddler 规则的情况下做到这一点。我已经通过修改 Fiddler 规则来做到这一点,但是该程序将在多台机器上使用,并且很难在每台机器上更改 Fiddler 规则。

我不知道这是否可能。

通过修改提琴手规则来做到这一点的代码是:

电源外壳 :

$filePath = "...\nameFile.txt" # file which contain the names of fiddler ZIP files
$file = Get-Content $filePath # content of nameFile
foreach ($line in $file) {
    start $line # open the file
    Write-Host "File : $line open"
    Start-Sleep -s 1    
}

& "...\Fiddler\ExecAction.exe" "failuresselection" # select all failures and make another file (see Fiddler Rules)

提琴手规则:

static function OnExecAction(sParams: String[]): Boolean {
   [...]
   // Select all failures and put them in a new ZIP file
   case "failuresselection":
      var path = "...\\Newlogs";                        
      UI.actSelectSessionsWithResponseCode(449);
      if (UI.GetFirstSelectedSession() != null){
       UI.actSaveSessionsToZip(path+"\\Logs" + 449 + ".saz");   
      }
      // Confirmation 
      FiddlerObject.StatusText = "Dumped all failures sessions to " + path; 
      UI.actExit();
      return true;
      [...]
}

我试试这个,但它不起作用:

& "...\Fiddler\ExecAction.exe" "FiddlerApplication.UI.actSelectAll();" 

这是选择所有行,但我认为 ExecAction.exe 替换了 QuickExec。

总之,我正在寻找一种方法来做同样的事情而不修改 Fiddler 规则。

标签: powershellfiddler

解决方案


推荐阅读