共用方式為


New-CrescendoCommand

建立 PowerShell 命令物件。

語法

New-CrescendoCommand
   [-Verb] <String>
   [-Noun] <String>
   [[-OriginalName] <String>]
   [<CommonParameters>]

Description

建立 PowerShell 命令物件。 您可以使用這個物件來設定您要定義的命令屬性。 產生的物件可以轉換成 JSON,以新增至組態檔。

範例

範例 1 - 建立新的命令,並將它轉換成 JSON

New-CrescendoCommand -Verb Get -Noun Something -OriginalName "native.exe" | ConvertTo-Json

{
  "Verb": "Get",
  "Noun": "Something",
  "OriginalName": "native.exe",
  "OriginalCommandElements": null,
  "Platform": [
    "Windows",
    "Linux",
    "MacOS"
  ],
  "Elevation": null,
  "Aliases": null,
  "DefaultParameterSetName": null,
  "SupportsShouldProcess": false,
  "ConfirmImpact": null,
  "SupportsTransactions": false,
  "NoInvocation": false,
  "Description": null,
  "Usage": null,
  "Parameters": [],
  "Examples": [],
  "OriginalText": null,
  "HelpLinks": null,
  "OutputHandlers": null,
  "FunctionName": "Get-Something"
}

參數

-Noun

您正在定義的 Cmdlet 名詞。

類型:String
Position:1
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-OriginalName

要執行的原生命令可執行檔名稱。

類型:String
Position:2
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Verb

您要定義的 Cmdlet 動詞。

類型:String
Position:0
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

輸入

None

輸出

Object