Book Image

Getting Started with Powershell

Book Image

Getting Started with Powershell

Overview of this book

Table of Contents (19 chapters)
Getting Started with PowerShell
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Next Steps
Index

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: