Import-CommandConfiguration

导入 PowerShell Crescendo json 文件。

语法

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

说明

此 cmdlet 导出可转换为充当特定于平台命令的代理的函数的对象。 然后,可以使用生成的对象调用可以参与 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
Position:0
默认值:None
必需:True
接受管道输入:False
接受通配符:False

输入

None

输出

A Command object

备注

Import-CommandConfiguration 返回的对象通过 ToString 方法转换。 通常,应使用 Export-CrescendoModule 创建 PowerShell .psm1 文件。