Adds a default document name to a website.


Add-IisDefaultDocument [-SiteName] <String> [-FileName] <String> [<CommonParameters>]


If you need a custom default document for your website, this function will add it. The FileName argument should be a filename IIS should use for a default document, e.g. home.html.

If the website already has FileName in its list of default documents, this function silently returns.

Beginning 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 name of the site where the default document should be added.

true false
FileName String

The default document to add.

true false


Add-IisDefaultDocument -SiteName MySite -FileName home.html

Adds home.html to the list of default documents for the MySite website.