Darksmilie
Darksmilie

Reputation: 201

Stop-IISSite without confirm dialog

I want to use the powershell command Stop-IISSite but i don't want to have the confirmation dailog.

Stop-IISSite -Name "WebSiteName"

The "-Confirm" parameter doesn't work on my tests, is there any option to force this stop?

Upvotes: 3

Views: 1544

Answers (2)

Usman Ali Maan
Usman Ali Maan

Reputation: 414

You can user

Stop-IISSite -Name "WebSiteName" -Confirm:$false

it worked in my case

Upvotes: 5

Bruce Zhang
Bruce Zhang

Reputation: 3042

Run powershell as administrator.

Import-Module IISAdministration
Stop-WebSite 'Default Web Site'

enter image description here

Upvotes: 0

Related Questions