Starting, stopping, and restarting IIS
Since you can run command-line programs in PowerShell, the IISReset
command can be used to start, stop, and restart IIS using the /START
, /STOP
, and /RESTART
switches:
If you want to start or stop a particular website rather than the entire IIS installation, you need to use the Start-WebSite
and Stop-WebSite
cmdlets. They both have a –Name
parameter that allows you to specify which site you want to work with. In the following screenshot, I am stopping and starting a website called Test
. Also, I have used the Get-WebSite
cmdlet after each step to show that the Test
site stopped and started correctly: