次の方法で共有


Get-SCScriptCommandSetting

スクリプト コマンドの設定を取得します。

構文

Get-SCScriptCommandSetting
   -ScriptCommand <SCScriptCommand>
   [<CommonParameters>]

説明

Get-SCScriptCommandSetting コマンドレットは、スクリプト コマンドで構成されている設定を取得します。

例 1: 特定のスクリプト コマンドのスクリプト コマンド設定を取得する

PS C:\> $AppProfile = Get-SCApplicationProfile -Name "SvcWebAppProfile01"
PS C:\> $ScriptCommand = Get-SCScriptCommand -ApplicationProfile $AppProfile | Where {$_.Name -eq "PostInstall"}
PS C:\> Get-SCScriptCommandSetting -ScriptCommand $ScriptCommand

最初のコマンドは、SvcWebAppProfile01 という名前のアプリケーション プロファイル オブジェクトを取得し、$AppProfile変数にオブジェクトを格納します。

2 番目のコマンドは、PostInstall という名前のスクリプト コマンド オブジェクトを取得し、そのオブジェクトを $ScriptCommand 変数に格納します。

最後のコマンドは、$ScriptCommandに格納されているスクリプト コマンドのスクリプト コマンド設定を取得し、ユーザーの設定を表示します。

パラメーター

-ScriptCommand

スクリプト コマンド オブジェクトを指定します。

Type:SCScriptCommand
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

出力

ScriptCommandSetting

このコマンドレットは ScriptCommandSetting オブジェクトを 返します。