3

我有一些基于线程Delete All Cached Objects in ARR Cache from Command Line or Powershell Script的 powershell

       try{
            $url = $file.get($i)

            $m =( new-object Microsoft.Web.Administration.ServerManager )
            $x = $m.GetApplicationHostConfiguration().GetSection("system.webServer/diskCache");
            $method = $x.Methods["FlushUrl"].CreateInstance()
            $method.Input.SetAttributeValue("url", $url)
            $method.Execute();
            $evt.WriteEntry("$ScriptName Cache item $file($i) flushed on $env:computername "  ,$infoevent,3)
        }catch{
            $detail = $_.Exception.ErrorRecord.ToString()
            $evt.WriteEntry("$ScriptName Error flushing cache item $file($i) on $env:computername : $detail"   ,$errevent,4)
        }

$url 从文件中读取。AFAIK 我应该以http://example.com的形式给这个网址

我希望这会清除 ARR IIS 应用程序和路由缓存文件夹中的一些缓存项,包括 full.gzip,但这个 full.gzip 仍然存在。

我要么错误地理解了它应该如何工作,要么 API 不可靠。

Win2012 IIS 8.0

4

0 回答 0