PowerShell Snap-in: Using the PowerShell Help System

By Thomas Deml

April 14, 2008

In this walkthrough you will learn how you can get help on how to use the IIS PowerShell Snap-in.

Introduction

The IIS PowerShell Snap-in uses two types of cmdlets.

  1. Built-in cmdlets like New-Item, Get-ChildItems or Set-ItemProperty, are implemented in every namespace (the file system for example) and also work with the IIS PowerShell Snap-in. These built-in cmdlets apply to containers that are exposed in the IIS hierarchy: Sites, Application Pools, Web Applications and Virtual Directories.
  2. IIS PowerShell Snap-in specific cmdlets like Get-WebConfiguration, Set-WebConfigurationProperty or Get-WebItemState are only applicable to IIS. These cmdlets have to be used to manage feature configuration or run-time state. Examples for feature configuration are defaultDocument configuration, compression settings, modules and handlers configuration etc. Run-time state examples are the state of Application Pools and Sites.

Help for Built-in Cmdlets

Getting help for these two types of cmdlets is different. To get help on how the built-in cmdlets can be used in the IIS:\ namespace you have to use the following command:

get-help WebAdministration | more

The output of this command will give you a detailed overview on how built-in cmdlets can be used in the IIS namespace. It shows you the syntax and what additional parameters need to be specified. And finally it will display a large set of examples that will help you to get familiar with these cmdlets.

Help for IIS-specific Cmdlets

If you want to get help for IIS-specific cmdlets you have to use the following command:

Get-Help <cmdlet name>

Examples:

Get-Help Get-WebConfiguration Get-Help Get-WebItemState Get-Help Add-WebConfigurationYou can execute the following command to retrieve a list of the cmdlets IIS provides:PS IIS:\> Get-Command -pssnapin IISProviderSnapIn CommandType Name Definition
----------- ---- ----------
Cmdlet Add-WebConfiguration Add-WebConfiguration [-Filter] <String...
Cmdlet Add-WebConfigurationProperty Add-WebConfigurationProperty [-Filter]...
Cmdlet Begin-Transaction Begin-Transaction [[-PSPath] <String[]...
Cmdlet Clear-WebConfiguration Clear-WebConfiguration [-Filter] <Stri...
Cmdlet End-Transaction End-Transaction [[-PSPath] <String[]>]...
Cmdlet Get-section Get-section [-Section] <String> [-PSPa...
Cmdlet Get-URL Get-URL [-Url <String>] [-PSPath <Stri...
Cmdlet Get-WebConfiguration Get-WebConfiguration [-Filter] <String...
Cmdlet Get-WebConfigurationProperty Get-WebConfigurationProperty [-Filter]...
Cmdlet Get-WebItemState Get-WebItemState [[-PSPath] <String[]>...
Cmdlet Remove-WebConfigurationProperty Remove-WebConfigurationProperty [-Filt...
Cmdlet Restart-WebItem Restart-WebItem [[-PSPath] <String[]>]...
Cmdlet Set-WebConfiguration Set-WebConfiguration [-Filter] <String...
Cmdlet Set-WebConfigurationProperty Set-WebConfigurationProperty [-Filter]...
Cmdlet Start-WebItem Start-WebItem [[-PSPath] <String[]>] [...
Cmdlet Stop-WebItem Stop-WebItem [[-PSPath] <String[]>] [-...

Summary

In this walkthrough you learned how to use the PowerShell help system to get more information on how to use built-in cmdlets in the IIS namespace, but also on how to use IIS-specific cmdlets.



Discuss in IIS Forums