我正在尝试使用Ansible通过win_chocolatey模块在Windows Server 2008 R2上安装软件。 它不起作用,因为它会引发错误:
[错误] – 巧克力WIN-2008r2(用户pipe理员)有一个错误:System.OutOfMemoryException:types'System.OutOfMemoryException'的exception被引发。 System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression lambda,DebugInfoGenerator debugInfoGenerator)上System.Reflection.Emit.DynamicMethod.CreateDelegate(typesdelegateType,Object target)上System.Runtime.CompilerServices.RuntimeHelpers._CompileMethod(IRuntimeMethodInfo方法)在System.Management.Automation.Interpreter.LoopCompiler.CreateDelegate()在System.Management.Automation.Interpreter.EnterLoopInstruction.Compile(对象frameObj)在System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallbackcallback,对象状态,布尔preserveSyncCtx )在System.Threading.ThreadPoolWorkQueue.Dispatch()System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallbackcallback,对象状态,Boolean preserveSyncCtx)
命令“choco install”在服务器上使用时有效。
我试图增加PowerShell和WinRM的内存限制。
set-item wsman:localhost \ Shell \ MaxMemoryPerShellMB 2048
winrm set winrm / config / winrs'@ {MaxMemoryPerShellMB =“2048”}'
还有什么可能是这个问题?
事实certificate,我需要此修复: https : //support.microsoft.com/en-us/help/2842230/-out-of-memory-error-on-a-computer-that-has-a-customized-maxmemorypershellmb -quota-设置和具有-WMF-3.0-安装
现在起作用了。