答案 0 :(得分:0)
Microsoft有一个关于如何使用visual basic
执行此操作的文档https://msdn.microsoft.com/en-us/library/windows/desktop/ms684192(v=vs.85).aspx
以下powershell将增加内存限制。您需要将$ AppID和$ CLSID更改为相应的标识符
$AppID = "{11111111-1111-1111-1111-111111111111}"
$CLSID = "{22222222-2222-2222-2222-222222222222}"
$comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog
function ConfigurePoolLimits ( $comAdmin , $MemoryLimit) {
Write-Host "Configuring Pool Limits"
$apps = $comAdmin.GetCollection("Applications")
$apps.Populate();
$changesMade = $false
foreach ($app in $apps ) {
if ($app.Name -eq $AppName ) {
Write-Host "Found Application $($app.Name)"
Write-Host "RecycleMemoryLimit is $($app.Value("RecycleMemoryLimit"))"
if ($app.Value("RecycleMemoryLimit") -ne $MemoryLimit) {
$changesMade = $true
Write-Host "Changing RecycleMemoryLimit to $($MemoryLimit)"
$app.Value("RecycleMemoryLimit") = $MemoryLimit
}
}
}
if ($changesMade) {
$apps.SaveChanges();
}
}
然后用2个参数调用该函数
ConfigurePoolLimits $comAdmin 1000000