New-CommandHelp

为会话中加载的 PowerShell 命令创建 CommandHelp 对象。

语法

__AllParameterSets

New-CommandHelp
    [-CommandInfo] <CommandInfo[]>
    [<CommonParameters>]

说明

此 cmdlet 获取一个或多个 PowerShell 命令的列表,并为每个命令创建 CommandHelp 对象。 CommandHelp 对象是可用于导出到不同格式的帮助内容的结构化表示形式。

示例

示例 1 - 为 cmdlet 创建一个 **CommandHelp** 对象

以下示例为 cmdlet 创建 New-PSSession 对象。 Get-Member cmdlet 用于显示 CommandHelp 对象的属性和方法。

New-CommandHelp New-PSSession | Get-Member
   TypeName: Microsoft.PowerShell.PlatyPS.Model.CommandHelp

Name                        MemberType Definition
----                        ---------- ----------
Equals                      Method     bool Equals(Microsoft.PowerShell.PlatyPS.Model.CommandHelp other)...
GetHashCode                 Method     int GetHashCode()
GetType                     Method     type GetType()
ToString                    Method     string ToString()
TryGetParameter             Method     bool TryGetParameter(string name, [ref] Microsoft.PowerShell.Plat...
Aliases                     Property   System.Collections.Generic.List[string] Aliases {get;}
Description                 Property   string Description {get;set;}
Diagnostics                 Property   Microsoft.PowerShell.PlatyPS.Model.Diagnostics Diagnostics {get;s...
Examples                    Property   System.Collections.Generic.List[Microsoft.PowerShell.PlatyPS.Mode...
ExternalHelpFile            Property   string ExternalHelpFile {get;set;}
HasCmdletBinding            Property   bool HasCmdletBinding {get;set;}
HasWorkflowCommonParameters Property   bool HasWorkflowCommonParameters {get;set;}
Inputs                      Property   System.Collections.Generic.List[Microsoft.PowerShell.PlatyPS.Mode...
Locale                      Property   cultureinfo Locale {get;set;}
Metadata                    Property   ordered Metadata {get;set;}
ModuleGuid                  Property   System.Nullable[guid] ModuleGuid {get;set;}
ModuleName                  Property   string ModuleName {get;set;}
Notes                       Property   string Notes {get;set;}
OnlineVersionUrl            Property   string OnlineVersionUrl {get;set;}
Outputs                     Property   System.Collections.Generic.List[Microsoft.PowerShell.PlatyPS.Mode...
Parameters                  Property   System.Collections.Generic.List[Microsoft.PowerShell.PlatyPS.Mode...
RelatedLinks                Property   System.Collections.Generic.List[Microsoft.PowerShell.PlatyPS.Mode...
SchemaVersion               Property   string SchemaVersion {get;set;}
Synopsis                    Property   string Synopsis {get;set;}
Syntax                      Property   System.Collections.Generic.List[Microsoft.PowerShell.PlatyPS.Mode...
Title                       Property   string Title {get;set;}

参数

-CommandInfo

一个或多个 PowerShell 命令的列表(cmdlet、函数、脚本)。 该 cmdlet 为每个命令创建 CommandHelp 对象。

参数属性

类型:

CommandInfo[]

默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:0
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

输入

CommandInfo

输出

Microsoft.PowerShell.PlatyPS.Model.CommandHelp