What a great time for IIS 7 integration with PowerShell which has already established itself as a stable and powerful scripting technology. The PowerShell IIS Provider was released on 15th April and can be downloaded from here for x86 systems, and, from here for the x64 systems. Won't take you a long time downloading the package, they are very small indeed :)
Ok, now that that we have the package downloaded lets run through few prerequisites (x86).
For the PowerShell IIS Provider to work with your machine (x86) must already be running the following:
Once done with the installation it is now time to start our exploration. Here we go...
Double click on the IIS PowerShell Management Console on the desktop. This will open up a PS window with the default IIS drive ... You will have this
PS IIS:\>
Lets see what we get when we do a dir on this
PS IIS:\> dir
and you get the following
Name
----
Sites
AppPools
Simple enough lets do a cd to sites .. And when a dir command is set on sites we get this :

This is great information. This gives you the information of all the websites(started or stopped). But all this was simple. What if, we wanted to use CmdLets to achieve this. Here is how you do it.
PS IIS:\>Get-Childitem sites
With this command you will get the same result as above.
But that is no big deal right ... so lets get something interesting... One of the best feature I love about PowerShell is to mix CmdLets in a single command... So lets try it out ...
Enter the following command in your IIS PowerShell Management Console:
Get-ItemProperty sites\'Default Web Site'; Get-ItemProperty sites\'Default Web Site'\*
and check out the volume of in-depth information you receive... ;)
All this was just to get you familiar with the groundwork on the PowerShell IIS Provider...
Will soon be coming out with a little more into PowerShell Provider for IIS 7 (adding websites, stopping services and finding out the workerprocess informations) ...
Till then you can check out the help file for IIS Administration through PowerShell...
How to do that?? :D
Simple ... type the following command
IIS:\> help webadministration
Ok, now that that we have the package downloaded lets run through few prerequisites (x86).
For the PowerShell IIS Provider to work with your machine (x86) must already be running the following:
- Windows Server 2008(x86) or Windows Vista Service pack 1(x86).
- Internet Information Services 7.0 .
- Windows PowerShell 1.0.
Once done with the installation it is now time to start our exploration. Here we go...
Double click on the IIS PowerShell Management Console on the desktop. This will open up a PS window with the default IIS drive ... You will have this
PS IIS:\>
Lets see what we get when we do a dir on this
PS IIS:\> dir
and you get the following
Name
----
Sites
AppPools
Simple enough lets do a cd to sites .. And when a dir command is set on sites we get this :

This is great information. This gives you the information of all the websites(started or stopped). But all this was simple. What if, we wanted to use CmdLets to achieve this. Here is how you do it.
PS IIS:\>Get-Childitem sites
With this command you will get the same result as above.
But that is no big deal right ... so lets get something interesting... One of the best feature I love about PowerShell is to mix CmdLets in a single command... So lets try it out ...
Enter the following command in your IIS PowerShell Management Console:
Get-ItemProperty sites\'Default Web Site'; Get-ItemProperty sites\'Default Web Site'\*
and check out the volume of in-depth information you receive... ;)
All this was just to get you familiar with the groundwork on the PowerShell IIS Provider...
Will soon be coming out with a little more into PowerShell Provider for IIS 7 (adding websites, stopping services and finding out the workerprocess informations) ...
Till then you can check out the help file for IIS Administration through PowerShell...
How to do that?? :D
Simple ... type the following command
IIS:\> help webadministration
1 comments:
This is informative stuff
Post a Comment