Add-IisDefaultDocument

Adds a default document name to a website.

Syntax

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

Description

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.

Parameters

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

EXAMPLE 1

Add-IisDefaultDocument -SiteName MySite -FileName home.html

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