IIS 7 PowerShell Provider
I always wondered why the IIS team didn't have any PowerShell provider or Cmdlets to manage the IIS platform through PowerShell, I know they had the AppCmd commandline tool to manage IIS from the commandline. But now the IIS team released their PowerShell provider to manage IIS servers.
Here is what you can do with the provider:
Create Websites, Applications, Application Pools, etc
Change different configuration properties on the Websites, Application Pools, Virtual Directories and more
Add, Change, Search and Discover Configuration Settings
I've installed the provider on one of my IIS demo boxes and here is what you can do to use it:
- You can use the shortcut created by the IIS Provider install package
- You can add the snapin into your PowerShell console by typing "Add-PSSnapin -name IISProviderSnapin"
- You can add the Add-PSSnapIn IIsProviderSnapIn to your profile.ps1 script, if this doesn't exist you need to create it manually in "My Documents\WindowsPowerShell"
After doing this I want to get a list of websites on my IIS Box:
Let's do one more basic example, create a new website:
Let's create the website directory by using the PowerShell console, here I used the mkdir alias but I also could use the new-item cmdlet
Now by using the set-content cmdlet I create a simple default.htm page
Finally we are going to create the website TestSite with port 83
Let's list the sites configured onto my demobox:
The IIS team created 9 how-to pages to get you started using the provider have a look at:
https://learn.iis.net/page.aspx/447/managing-iis-with-the-iis-70-powershell-provider
The IIS 7.0 PowerShell Provider can be found here:
x86: https://www.iis.net/downloads/1664/ItemPermaLink.ashx
x64: https://www.iis.net/downloads/1665/ItemPermaLink.ashx
Technorati Tags: IIS,Windows Server 2008,PowerShell,Internet Information Server