Hiroshi Okunushi's Blog ☆ミ| IIS PHP etc.

IIS7, PHP on IIS を中心とした情報発信ブログです。

[独自翻訳] PowerShell のヘルプシステムを使用する

[独自翻訳] PowerShell のヘルプシステムを使用する

  • Comments 1
  • Likes

This post is a translation of the article specified below.
本投稿は IIS.NET の記事をブログオーナーが独自に翻訳したものです。参考情報としてご利用ください。

ウォークスルーの一覧は [独自翻訳] IIS 7.0 PowerShell プロバイダ を使ってみよう!  をご覧ください。

/*原文*/

Using the PowerShell Help System
http://learn.iis.net/page.aspx/432/using-the-powershell-help-system

/*翻訳*/

本ウォークスルーでは IIS7.0 PowerShell プロバイダについてのヘルプにアクセスする方法について学びます。

はじめに

IIS 7.0 PowerShell プロバイダは 2種類のコマンドレットを利用します。

  1. New-Item, Get-ChildItems, Set-ItemProperty のようなビルトインのコマンドレット
    それぞれのネームスペースに実装されていて(例えば ファイルシステム)IIS 7.0 PowerShell プロバイダに対しても動作するもの。これらのビルトインコマンドレットは IIS の階層として公開されているコンテナに対して実行できます。 Sites, Application Pools, Web Applications そして Virtual Directories です。
  2. IIS 7.0 PowerShell プロバイダ専用のコマンドレット
    Get-WebConfiguration, Set-WebConfigurationProperty, Get-WebItemState などは IIS に対してのみ利用可能なものです。これらのコマンドレットは機能設定や実行時情報の取得などには不可欠なものです。ここでいう機能設定の例は 既定のドキュメント 設定、圧縮 設定、モジュールやハンドラー 設定 などです。実行時情報の例としては、アプリケーションプールやサイトの状態を取得したい場合 などです。

ビルトイン コマンドレットのヘルプ

これら2種類のコマンドレットでヘルプにアクセスする方法は異なります。IIS:\ ネームスペースでビルトインのコマンドレットでヘルプにアクセスしたい場合には 以下のコマンドを使用します。

get-help WebAdministration | more

このコマンドの出力は IIS ネームスペースでそのコマンドレットがどのように利用できるかの概要になります。コマンドの構文や追加で指定する必要があるパラメータを表示します。そして最後に、このコマンドレットに慣れていただくための多くのコマンド実行例を表示します。

IIS 専用コマンドレットのヘルプ

IIS 専用コマンドレットでヘルプにアクセスしたい場合には下記のコマンドを使用する必要があります。

Get-Help <cmdlet name>

例:

Get-Help Get-WebConfiguration

Get-Help Get-WebItemState

Get-Help Add-WebConfiguration

 

下記のコマンドを実行すると IIS 専用コマンドレットの一覧が取得できます。

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[]>] [-...

まとめ

本ウォークスルーでは PowerShell のヘルプシステムの使い、IISネームスペースでのビルトインのコマンドレットについての情報を得る方法を学びました。また IIS のコマンドレットの使い方も学びました。

/* 翻訳 終わり*/

Comments
  • This post is a translation of the article specified below. 本投稿は IIS.NET の記事をブログオーナーが独自に翻訳したものです。参考情報としてご利用ください。

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment