Import-CommandConfiguration
匯入 PowerShell Crescendo json 檔案。
Syntax
Import-CommandConfiguration
[-file] <String>
[<CommonParameters>]
Description
此 Cmdlet 會匯出可轉換成函式的物件,做為平臺特定命令的 Proxy。 然後,結果物件可用來呼叫可參與 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
檔案。
相關連結
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應