powershell - 设置 IIS 默认应用程序池队列长度 Powershell
问题描述
我正在尝试以编程方式设置 IIS 设置,我已经设法完成了大部分设置。
首先我跑
Get-ItemProperty IIS:/AppPools\DefaultAppPool | Select *
这给了我 queuelength 属性名称,然后我使用
Set-ItemProperty IIS:/AppPools\DefaultAppPool -Name QueueLength -Value 5000
但是,这不会更改 IIS 默认应用程序池的设置,任何我出错的想法:(
谢谢
解决方案
我能够使用 PSPath 做到这一点
Import-Module WebAdministration
$defaultAppPool = Get-ItemProperty IIS:\AppPools\DefaultAppPool
#$defaultAppPool.PSPath
Write-Host "Display Queue Length before change: " -NoNewline
(Get-ItemProperty IIS:\AppPools\DefaultAppPool\).queueLength
#Value changed here
Set-ItemProperty -Path $defaultAppPool.PSPath -Name queueLength -Value 5000
Write-Host "Display Queue Length after change: " -NoNewline
(Get-ItemProperty IIS:\AppPools\DefaultAppPool\).queueLength
输出:
Display Queue Length before change: 4000
Display Queue Length after change: 5000
推荐阅读
- http - 找不到与具有绑定 BasicHttpBinding 的端点的方案 https 匹配的基地址。注册的基地址方案是 [http]
- here-api - 使用 HERE Rest API 的最佳实践 - 直接通过客户端或通过我的后端服务器
- r - 基于 P 值显示回归线
- python - Pandas:基于条件的列的唯一值
- entity-framework - 根据表中的类名将不同的数据集反序列化为不同的类
- php - 如何在 wordpress functions.php 中发送一系列类别和帖子?
- typescript - 函数的参数在Typescript中指定了几种函数类型
- javascript - kubernetes-client javascript - 从 cronjob 创建作业
- autodesk-forge - 获得视角 [Autodesk 模型衍生 API]
- python - 我如何找到最小值?