Windows Powershell方法(对象能做什么)
方法定义了一个对象可以做什么事情。当你把一个对象输出在控制台时,它的属性可能会被转换成可视的文本。但是它的方法却不可见。列出一个对象的所有方法可是使用Get-Member命令,给“MemeberType”参数 传入“Method”:
PS C:Powershell> $Host | Get-Member -MemberType Method
TypeName: System.Management.Automation.Internal.Host.InternalHost
Name MemberType Definition
---- ---------- ----------
EnterNestedPrompt Method System.Void EnterNestedPrompt()
Equals Method bool Equals(System.Object obj)
ExitNestedPrompt Method System.Void ExitNestedPrompt()
GetHashCode Method int GetHashCode()
GetType Method type GetType()
NotifyBeginApplication Method System.Void NotifyBeginApplication()
NotifyEndApplication Method System.Void NotifyEndApplication()
PopRunspace Method System.Void PopRunspace()
PushRunspace Method System.Void PushRunspace(runspace runspace)
SetShouldExit Method System.Void SetShouldExit(int exitCode)
ToString Method string ToString()
以上是 Windows Powershell方法(对象能做什么) 的全部内容, 来源链接: utcz.com/z/354203.html