I've got the following command to add a MIME
type to IIS
using PowerShell
add-webconfigurationproperty //staticContent -name collection -value @{fileExtension='.xpa'; mimeType='application/octet-stream'}
How can I check if the MIME type exists first before invoking add-webconfigurationproperty
?
You can check with the following:
if( !((Get-WebConfiguration //staticcontent).collection | ? {$_.fileextension -eq '.xpa'}) ) {
#do something
}