Modifier

Partager via


Stop-WebItem

Stops a site or an application pool.

Syntax

Stop-WebItem
    [-Passthru]
    [-Protocol <String>]
    [[-PSPath] <String[]>]
    [<CommonParameters>]

Description

The Stop-WebItem cmdlet stops a site or an application pool.

Examples

Example 1: Stop a website

IIS:\> Stop-WebItem -PSPath "IIS:\Sites\Default Web Site"

This command stops the site named Default Web Site. No output is returned.

Example 2: Stop a website with feedback

IIS:\> Stop-WebItem -PSPath "IIS:\Sites\Default Web Site" -Passthru
Name        ID     State    Physical Path                  Bindings

----        --     -----    -------------                  --------

Default Web Site 1 Stopped  C:\inetpub\wwwroot\Default Web http *:80:

Site

This command stops the site named Default Web Site and reports whether the site was stopped.

Parameters

-Passthru

Passes an object that represents the web item to the pipeline.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Protocol

Specifies the protocol binding of the site to stop. This parameter applies to sites only.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PSPath

Specifies the path to the site or application pool.

Type:String[]
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Inputs

PSObject

Outputs

PSObject