简体   繁体   English

PowerShell是否具有导致错误的限制?没有足够的配额来处理此命令?

[英]Does PowerShell have a limit that causes the error Not enough quota is available to process this command?

We have a deployment script that is failing with the error message: Not enough quota is available to process this command. 我们有一个失败的错误消息的部署脚本: 没有足够的配额可用于处理此命令。

At the point where it fails it is attempting to start an executable asynchronously after having already started the same executable 10 times. 在失败之前,它已经尝试启动同一可执行文件10次后尝试异步启动该可执行文件。 So number 11 fails. 因此11号失败。 A total of 17 need to be started. 总共需要启动17个。 This script is not written in PowerShell but we use a remote PowerShell session to launch it and this error only happens when we run the script via PowerShell remoting. 该脚本不是用PowerShell编写的,但是我们使用远程PowerShell会话来启动它,并且仅当我们通过PowerShell远程处理运行脚本时才会发生此错误。

If we run the same script directly on the server without using PowerShell remoting we don't get this error and the script has no problem launching all instances of the exe (17 in total) and finishing without error. 如果我们直接在服务器上运行相同的脚本而不使用PowerShell远程处理,则不会出现此错误,并且脚本在启动exe的所有实例(共17个)并完成而没有错误的过程中都没有问题。

I have checked on the typical WSMAN limits that I suspected might be the cause of the error and they are set to unlimited as far as I can tell. 我已经检查了我怀疑可能是导致错误的典型WSMAN限制,据我所知,它们被设置为无限制。 At first I thought maybe MaxProcessesPerShell was set too low. 起初我以为MaxProcessesPerShell可能设置得太低。 Here are the results from the WSMAN drive on the server where this is running: 这是运行它的服务器上的WSMAN驱动器的结果:

We have these WSMAN settings currently: 当前,我们具有以下WSMAN设置:

> WSMan:\localhost\Shell> dir

   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Shell

Type            Name                           SourceOfValue   Value
----            ----                           -------------   -----
System.String   AllowRemoteShellAccess                         true
System.String   IdleTimeout                                    7200000
System.String   MaxConcurrentUsers                             2147483647
System.String   MaxShellRunTime                                2147483647
System.String   MaxProcessesPerShell                           2147483647
System.String   MaxMemoryPerShellMB                            2147483647
System.String   MaxShellsPerUser                               2147483647

Is there any other PowerShell or WSMAN setting that might be the cause of this error? 是否有其他任何PowerShell或WSMAN设置可能是导致此错误的原因?

The typical solution that is recommended for the Not enough quota... error involves making the Page file bigger. 对于“ 配额不足...”错误,建议使用的典型解决方案包括使Page文件更大。 I have not tried that yet because the script runs error free outside of a PowerShell session. 我还没有尝试过,因为该脚本在PowerShell会话外部运行无错误。

I can provide more specifics about what our script is doing if that is needed to help answer this question. 如果需要帮助我们解答此问题,我可以提供有关脚本执行方式的更多详细信息。

The quota limit that was causing my error was the MaxProcessesPerShell setting on the PowerShell 32 bit plugin. 导致我出错的配额限制是PowerShell 32位插件上的MaxProcessesPerShell设置。 This setting is independent of the Shell setting. 此设置独立于外壳程序设置。 To fix the issue I ran the follow commands in the remote PowerShell session... 要解决此问题,我在远程PowerShell会话中运行了以下命令...

 dir WSMan:\localhost\Plugin\microsoft.powershell32\Quotas\MaxProcessesPerShell

Results... 结果...

Type            Name                           SourceOfValue   Value
----            ----                           -------------   -----
System.String   MaxProcessesPerShell                           15

Change the setting to 25 with... 使用...将设置更改为25

Set-Item WSMan:\localhost\Plugin\microsoft.powershell32\Quotas\MaxProcessesPerShell 25

Restart the WinRM service with... 使用以下命令重新启动WinRM服务:

Restart-Service WinRM

Tried running the problem script again with this new quota in effect and it now launches all 17 instances of the exe without any error. 尝试使用新的配额再次运行问题脚本,现在它可以启动exe的所有17个实例,而不会出现任何错误。 There is also a 64 bit PowerShell plugin which has it's own setting for this too. 还有一个64位PowerShell插件,对此也有其自己的设置。

This solution was found here Not enough quota is available to process this command 在此找到此解决方案没有足够的配额来处理此命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Powershell异常:没有足够的配额来处理此命令 - Powershell Exception: Not enough quota is available to process this command Start-Process Powershell命令中的Verb RunAs导致错误 - Verb RunAs in a Start-Process Powershell command causes an error 启动过程没有足够的配额 - Start-Process Not Enough Quota 如何解决“DNS 区域通过 PowerShell 没有足够的标签”错误 - How to resolve "DNS Zone does not have enough labels via PowerShell" error 参数化值导致 powershell/msbuild 命令出错 - Parameterising values causes error in powershell/msbuild command 将进程添加到arrayList时,导致powershell错误的原因是什么? - What causes error in powershell when adding process to arrayList? 带有-ArgumentList 类型命令的`Start-Process PowerShell` 不会调用命令 - `Start-Process PowerShell` with -ArgumentList of type command does not invoke command PowerShell:命令“ Get-ChildItem IIS:\\ Sites”导致错误 - PowerShell: command “Get-ChildItem IIS:\Sites” causes an error 如何在文件夹中包含Powershell处理文件并如何传递带有变量的CMD命令 - How to have Powershell process files in a folder and pass a CMD command with variables powershell invoke-command 不处理 try-cache 块 - powershell invoke-command does not process try-cache block
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM