You can use ADSI and powershell 2.0.
$adsiPrefix = "IIS://$serverName" $iisPath = "W3SVC" $iisADSI = [ADSI]"$adsiPrefix/$iisPath" $site = $iisADSI.Create("IISWebServer", $script:webSiteNumber) $xapMimeType = New-Object -comObject MimeMap SetCOMProperty $xapMimeType "Extension" ".xap" SetCOMProperty $xapMimeType "MimeType" "application/x-silverlight-app" $site.Properties["MimeMap"].Add($xapMimeType) $site.SetInfo() $site.CommitChanges() function SetCOMProperty($target, $member, $value) { $target.psbase.GetType().InvokeMember($member, [System.Reflection.BindingFlags]::SetProperty, $null, $target, $value) }
source share