New-CommandHelp
為工作階段中載入的 PowerShell 命令建立 CommandHelp 物件。
語法
__AllParameterSets
New-CommandHelp
[-CommandInfo] <CommandInfo[]>
[<CommonParameters>]
Description
此 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 物件。
參數屬性
| 類型: | |
| 預設值: | 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。