您可以使用PowerShell中的任何.NET类型及其静态方法.要枚举当前加载到AppDomain中的所有内容,您可以执行以下操作:
[AppDomain]::CurrentDomain.GetAssemblies() | foreach { $_.GetTypes() } | foreach { $_.GetMethods() } | where { $_.IsStatic } | select DeclaringType, Name | format-table
Run Code Online (Sandbox Code Playgroud)
请记住,您不仅限于静态方法,还可以使用new-object和调用实例方法来实例化类型.您可以get-member在实例上使用以获取类型的方法.
此外,如果要列出可用的CmdLets,只需调用:
Get-Command
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3648 次 |
| 最近记录: |