今天遇到同事一段脚本,通过WebRequest请求一个web页面,执行多次后就会卡住,并且提示超时。原因:Response占的资源没有释放,Response 实现了IDisposable接口。解决方案:调用$resp.Close()方法,释放资源。 PowerShell 中的WebRequest 执行多次后超时2013年7月13日 在 Powershell / Powershell小技巧 标签 WebRequest 来自 Mooser Lee