Created
April 24, 2020 00:56
-
-
Save georgepaoli/7d3a0c967c9810d7a95b0b9cffd9f4f4 to your computer and use it in GitHub Desktop.
Comando uteis no Powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clear IIS requestLimits | |
Get-IISConfigSection "system.webServer/security/requestFiltering" -CommitPath "Default Web Site" | Get-IISConfigElement -ChildElementName 'requestLimits' | Remove-IISConfigElement -Confirm:$false | |
# change IIS requestLimits | |
$requestFiltering = Get-IISConfigSection -CommitPath 'Default Web Site' -SectionPath 'system.webServer/security/requestFiltering' | |
$requestLimits = Get-IISConfigElement -ConfigElement $requestFiltering -ChildElementName 'requestLimits' | |
Set-IISConfigAttributeValue -ConfigElement $requestLimits -AttributeName "maxAllowedContentLength" -AttributeValue 209715200 | |
# change IIS requestLimits by xml | |
$file = 'C:\inetpub\wwwroot\web.config' | |
$xml = [xml](Get-Content $file) | |
$xml.SelectNodes("/configuration/system.webServer/security/requestFiltering/requestLimits") | foreach{$_.maxAllowedContentLength = "209715200"} | |
$xml.Save($file); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment