次の方法で共有


Import-CommandConfiguration

PowerShell Crescendo json ファイルをインポートします。

構文

Import-CommandConfiguration
      [-file] <String>
      [<CommonParameters>]

説明

このコマンドレットは、プラットフォーム固有のコマンドのプロキシとして機能する関数に変換できるオブジェクトをエクスポートします。 その後、結果のオブジェクトを使用して、PowerShell パイプラインに参加できるネイティブ コマンドを呼び出すことができます。 出力オブジェクトの ToString メソッドは、ネイティブ コマンドを呼び出す関数を作成するために使用できる文字列を返します。 ネイティブ コマンドがすべてのプラットフォーム上にある場合は、Microsoft Windows、Linux、および macOS で生成された関数を実行できます。

例 1

Import-CommandConfiguration ifconfig.crescendo.json

Verb                    : Invoke
Noun                    : ifconfig
OriginalName            : ifconfig
OriginalCommandElements :
Aliases                 :
DefaultParameterSetName :
SupportsShouldProcess   : False
SupportsTransactions    : False
NoInvocation            : False
Description             : This is a description of the generated function
Usage                   : .SYNOPSIS
                          Run invoke-ifconfig
Parameters              : {[Parameter()]
                          [string]$Interface = ""}
Examples                :
OriginalText            :
HelpLinks               :
OutputHandlers          :

パラメーター

-file

ラップするコマンドを表す JSON ファイル。

型:String
配置:0
規定値:None
必須:True
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

入力

None

出力

A Command object

メモ

Import-CommandConfiguration によって返されるオブジェクトは、ToString メソッドを使用して変換されます。 一般に、Export-CrescendoModule を使用して PowerShell .psm1 ファイルを作成する必要があります。