Get-IisMimeMap

Gets the file extension to MIME type mappings.

Syntax

Get-IisMimeMap [-FileExtension <String>] [-MimeType <String>] [<CommonParameters>]
Get-IisMimeMap -SiteName <String> [-VirtualPath <String>] [-FileExtension <String>] [-MimeType <String>] [<CommonParameters>]

Description

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:

Beginning with Carbon 2.0.1, this function is available only if IIS is installed.

Related Commands

Parameters

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 *

Return Values

Carbon.Iis.MimeMap.

EXAMPLE 1

Get-IisMimeMap

Gets all the the file extension to MIME type mappings for the web server.

EXAMPLE 2

Get-IisMimeMap -FileExtension .htm*

Gets all the file extension to MIME type mappings whose file extension matches the .htm* wildcard.

EXAMPLE 3

Get-IisMimeMap -MimeType 'text/*'

Gets all the file extension to MIME type mappings whose MIME type matches the text/* wildcard.

EXAMPLE 4

Get-IisMimeMap -SiteName DeathStar

Gets all the file extenstion to MIME type mappings for the DeathStar website.

EXAMPLE 5

Get-IisMimeMap -SiteName DeathStar -VirtualPath ExhaustPort

Gets all the file extension to MIME type mappings for the DeathStar's ExhausePort directory.