Import-CommandConfiguration
导入 PowerShell Crescendo json 文件。
语法
Default (默认值)
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 |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输入
None
输出
A Command object
备注
Import-CommandConfiguration 返回的对象通过 ToString 方法转换。
通常,应使用 Export-CrescendoModule 创建 PowerShell .psm1 文件。