Gets the file extension to MIME type mappings.
Get-IisMimeMap [-FileExtension <String>] [-MimeType <String>] [<CommonParameters>]
Get-IisMimeMap -SiteName <String> [-VirtualPath <String>] [-FileExtension <String>] [-MimeType <String>] [<CommonParameters>]
IIS won't serve static content unless there is an entry for it in the web server or website's MIME map configuration. This function will return all the MIME maps for the current server. The objects returned are instances of the Carbon.Iis.MimeMap
class, and contain the following properties:
FileExtension
: the mapping's file extensionMimeType
: the mapping's MIME typeBeginning with Carbon 2.0.1, this function is available only if IIS is installed.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
SiteName | String | The website whose MIME mappings to return. If not given, returns the web server's MIME map. |
true | false | |
VirtualPath | String | The directory under the website whose MIME mappings to return. Optional. |
false | false | |
FileExtension | String | The name of the file extensions to return. Wildcards accepted. |
false | false | * |
MimeType | String | The name of the MIME type(s) to return. Wildcards accepted. |
false | false | * |
Carbon.Iis.MimeMap.
Get-IisMimeMap
Gets all the the file extension to MIME type mappings for the web server.
Get-IisMimeMap -FileExtension .htm*
Gets all the file extension to MIME type mappings whose file extension matches the .htm*
wildcard.
Get-IisMimeMap -MimeType 'text/*'
Gets all the file extension to MIME type mappings whose MIME type matches the text/*
wildcard.
Get-IisMimeMap -SiteName DeathStar
Gets all the file extenstion to MIME type mappings for the DeathStar
website.
Get-IisMimeMap -SiteName DeathStar -VirtualPath ExhaustPort
Gets all the file extension to MIME type mappings for the DeathStar
's ExhausePort
directory.