OutputType 屬性宣告

OutputType屬性會識別 Cmdlet、函式或腳本所傳回的 .NET Framework 類型。

語法

[OutputType(params string[] type)]
[OutputType(params Type[] type)]
[OutputType(params string[] type, Named Parameters...)]
[OutputType(params Type[] type, Named Parameters...)]

參數

輸入 (string[]Type[]) 需要。 指定 Cmdlet 函數或腳本所傳回的類型。

ParameterSetName (string [] ) 選擇性。 指定傳回參數中所指定類型的參數集 type

providerCmdlet 選擇性。 指定可傳回參數中所指定類型的提供者 Cmdlet type

另請參閱

撰寫 Windows PowerShell Cmdlet