我只是在PowerShell中尝试一些事情, 在一些测试循环函数中, 发现调用深度 设置为1000 出错。 我在互联网上查看了一些信息, 发现这是因为 PowerShell 处理错误( 如果正确的话 ) :
The recursion depth limit is fixed in version 1. Deep recursion was causing problems in 64-bit mode because of the way exceptions were being processed. It was causing cascading out-of-memory errors. The net result was that we hard-limited the recursion depth on all platforms to help ensure that scripts would be portable to all platforms. - Bruce Payette, co-designer of PowerShell
我还在MSDN上找到了这个例外页面,其中指出这一限制是可配置的(但我没有发现任何关于如何配置的限制)——见评论部分这里。
如何设定此限制? < / 强 >