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 文件。

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

输入

None

输出

A Command object

备注

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