Skip to content

Instantly share code, notes, and snippets.

View DoctahPopp871's full-sized avatar

apopp DoctahPopp871

  • New York NY
View GitHub Profile
@GiscardBiamby
GiscardBiamby / configure-iis-httpCompression.ps1
Last active November 14, 2017 11:45
PowerShell snippet for configuring <system.webServer><httpCompression>. Using this in the startup script for an Azure Cloud Service.
[xml]$config = (& "$env:WINDIR\system32\inetsrv\appcmd.exe" list config /section:httpCompression)
if ($config -ne $null -and ($config.GetElementsByTagName("httpCompression") -ne $null)) {
$compression = $config.GetElementsByTagName("httpCompression")[0]
$dynamic = $compression.dynamicTypes
EnableCompression $dynamic "dynamicTypes" "application/x-javascript"
EnableCompression $dynamic "dynamicTypes" "application/atom+xml"
}