【发布时间】:2020-07-29 13:49:09
【问题描述】:
我正在尝试将“最大内容长度”的值配置为“30000000”(大约 28.6 MB)。我的脚本如下-
cd C:\Windows\System32\inetsrv
./appcmd set config /section:requestfiltering /requestlimits.maxallowedcontentlength:30000000
If ((Get-WindowsFeature Web-Filtering).Installed -EQ $true) {
Get-Website | Foreach-Object {
$site = $_
[PSCustomObject]@{
"Site" = $site.Name
"maxAllowedContentLength" = (((Get-WebConfiguration -Filter 'system.webServer/security/requestFiltering' -PSPath "IIS:\sites\$($site.Name)").requestLimits).Attributes | Where-Object Name -EQ 'maxAllowedContentLength').Value
}
}
}
脚本成功执行,但是当我使用“Internet 服务管理器”检查时,没有任何变化反映在那里。我想知道脚本中是否有任何错误?因为它不会返回任何错误来进行故障排除。
【问题讨论】:
标签: windows powershell iis automation registry