PowerShell Get-Member 查看对象的成员列表#yyds干货盘点#

网友投稿 1067 2022-09-17

PowerShell Get-Member 查看对象的成员列表#yyds干货盘点#

PowerShell Get-Member 查看对象的成员列表#yyds干货盘点#

环境配置说明

Windows 21H1 PSVersion 5.1.19041.1320

示例

PS C:\Users\admin> Get-Alias | Get-Member TypeName:System.Management.Automation.AliasInfo Name MemberType Definition ---- ---------- ---------- Equals Method bool Equals(System.Object obj) GetHashCode Method int GetHashCode() GetType Method type GetType() ResolveParameter Method System.Management.Automation.ParameterMet... ToString Method string ToString() CommandType Property System.Management.Automation.CommandTypes... Definition Property string Definition {get;} Description Property string Description {get;set;} Module Property psmoduleinfo Module {get;} ModuleName Property string ModuleName {get;} Name Property string Name {get;} Options Property System.Management.Automation.ScopedItemOp... OutputType Property System.Collections.ObjectModel.ReadOnlyCo... Parameters Property System.Collections.Generic.Dictionary[str... ParameterSets Property System.Collections.ObjectModel.ReadOnlyCo... ReferencedCommand Property System.Management.Automation.CommandInfo ... RemotingCapability Property System.Management.Automation.RemotingCapa... ResolvedCommand Property System.Management.Automation.CommandInfo ... Source Property string Source {get;} Version Property version Version {get;} Visibility Property System.Management.Automation.SessionState... DisplayName ScriptProperty System.Object DisplayName {get=if ($this.... HelpUri ScriptProperty System.Object HelpUri {get=$oldProgressPr... ResolvedCommandName ScriptProperty System.Object ResolvedCommandName {get=$t...

Get-Alias对象的属性

CommandType Property System.Management.Automation.CommandTypes... Definition Property string Definition {get;} Description Property string Description {get;set;} Module Property psmoduleinfo Module {get;} ModuleName Property string ModuleName {get;} Name Property string Name {get;} Options Property System.Management.Automation.ScopedItemOp... OutputType Property System.Collections.ObjectModel.ReadOnlyCo... Parameters Property System.Collections.Generic.Dictionary[str... ParameterSets Property System.Collections.ObjectModel.ReadOnlyCo... ReferencedCommand Property System.Management.Automation.CommandInfo ... RemotingCapability Property System.Management.Automation.RemotingCapa... ResolvedCommand Property System.Management.Automation.CommandInfo ... Source Property string Source {get;} Version Property version Version {get;} Visibility Property System.Management.Automation.SessionState... DisplayName ScriptProperty System.Object DisplayName {get=if ($this.... HelpUri ScriptProperty System.Object HelpUri {get=$oldProgressPr... ResolvedCommandName ScriptProperty System.Object ResolvedCommandName {get=$t...

通过将Get-Alias的结果导出成csv文件的方法,可以查看到列名和Property是相互对应的。在powershell中,存在多种类型的Property,比如ScriptProperty等。

PS C:\Users\admin> Get-Alias | Export-Csv alias.csv

#TYPE System.Management.Automation.AliasInfo "HelpUri","ResolvedCommandName","DisplayName","ReferencedCommand","ResolvedCommand","Definition","Options","Description","OutputType","Name","CommandType","Source","Version","Visibility","ModuleName","Module","RemotingCapability","Parameters","ParameterSets"

Get-Alias对象的方法

Equals Method bool Equals(System.Object obj) GetHashCode Method int GetHashCode() GetType Method type GetType() ResolveParameter Method System.Management.Automation.ParameterMet... ToString Method string ToString()

学习资料

PowerShell 版本 + 工具 PowerShell/PowerShell 51CTO社区

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:PowerShell Get-Module 查看PSModulePath路径中的模块#yyds干货盘点#
下一篇:Python数据分析之双色球高频数据统计(双色球实时数据统计分析)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~