views:

173

answers:

2

I have multiple sites configured in IIS7 on my Windows7 development machine to run on the same port and usually only run one at a time depending on what I'm working on. I would like to be able to start and stop my development sites from PowerShell instead of having the IIS manager opened. Does anyone have a good resource to point me in the right direction or a script that already accomplishes this?

Thanks

+2  A: 

Just for future quick reference, the commands are:

Import-Module WebAdministration
Stop-WebSite 'Default Web Site'
Start-WebSite 'Default Web Site'
Keith Hill
I'm a total PowerShell noob. Do I need to import anything prior to the code you posted? What I tried was launching PowerShell then typing the first cmd you posted and PowerShell threw an error.
Joey Green
After reading the exception it said that I didn't need to Import WebAdministration but next it told me that Start-Website 'SiteName' as not a recognized cmdlet.
Joey Green