OutputType 具有类型 System.Collections.ObjectModel.ReadOnlyCollection``1[[System.Management.Automation.PSTypeName,System.Management.Automation]]。 Parameters 具有类型 System.Collections.Generic.Dictionary``2[[System.String,mscorlib],[System.Management.Automation.ParameterMetadata,System.Management.Automation]]。
命令应返回与在中OutputType声明的相同类型。 可以通过在 PowerShell 中运行Get-Help about_Functions_OutputTypeAttribute命令来获取更多详细信息。 方式 指定OutputType 属性列表和 cmdlet 中返回的类型匹配。 示例 错 PowerShell functionGet-Foo{ [CmdletBinding()] [OutputType([String])]Param( )return4} ...
[OutputType([<Type1>], ParameterSetName=("<Set1>","<Set2>"))] [OutputType([<Type2>], ParameterSetName="<Set3>")] 将OutputType 属性语句放置在 param 语句之前的属性列表中。 以下示例显示了在简单函数中放置 OutputType 属性。 PowerShell 复制 function SimpleFunction2 { [OutputType(...
IT Pro PowerShell experience Share what I know or discovered when working with Windows PowerShell. Search Main menu Home About Tag Archives: OutputType Event 2: My way… Posted on May 7, 2013 13 Now that event 2 is closed for new entries – time to let you guys know how I wou...
about_Functions_OutputTypeAttribute about_Function_Provider about_Group_Policy_Settings about_Hash_Tables about_Hidden about_History about_If about_Intrinsic_Members about_Jobs about_Job_Details about_Join about_Language_Keywords about_Language_Modes about_Line_Editing about_Locations about_L...
$typeDataParams = @{ MemberType = 'ScriptProperty' MemberName = 'SupportsUpdatableHelp' Value = { [OutputType([bool])] param() return (-not [string]::IsNullOrEmpty($this.HelpInfoUri)) } } Get-Module Microsoft.PowerShell.Utility | Update-TypeData @typeDataParams Get-Module -ListAvailable ...
about_Functions_Advanced_Parameters about_Functions_OutputTypeAttribute about_Functions_CmdletBindingAttribute about_Hash_Tables about_Preference_Variables about_Splatting about_Variables在GitHub 上与我们协作 可以在 GitHub 上找到此内容的源,还可以在其中创建和查看问题和拉取请求。 有关详细信息,请参阅参与者指...
$typeDataParams = @{ MemberType = 'ScriptProperty' MemberName = 'SupportsUpdatableHelp' Value = { [OutputType([bool])] param() return (-not [string]::IsNullOrEmpty($this.HelpInfoUri)) } } Get-Module Microsoft.PowerShell.Utility | Update-TypeData @typeDataParams Get-Module -ListAvailable ...
about_Functions_OutputTypeAttribute 介绍报告函数返回的对象类型的属性。 about_Group_Policy_Settings 介绍Windows PowerShell 的组策略设置。 about_Hash_Tables 介绍如何创建、使用和排序 Windows PowerShell 中的哈希表。 about_History 说明如何从命令历史记录中获取和运行命令。
powershell具有在硬盘中易绕过,内存中难查杀的特点。一般在后渗透中,攻击者可以在计算机上执行代码时,...