1
使用System.Management.Automation,您可以在C#中創建自定義PSCmdlets。 現在,如果你創建布爾參數是這樣的:如何使PSCmdlet布爾參數像標誌一樣工作?
[Parameter()]
public bool ShowDefinition { get; set; }
你必須調用cmdlet的是這樣的:
PS> Get-CustomValues -ShowDefinition 1
但我想調用它沒有通過價值-ShowDefinition。與-Debug的工作方式相同。 喜歡傾向:
PS> Get-CustomValues -ShowDefinition
我該怎麼做?