作为.NET平台的开发人员,我喜欢通过浏览API文档来“探索”平台,框架或API,这些文档解释了什么是一切 – 一切都被覆盖,当我使用reflection器或对象浏览器等工具时,知道我在做什么。 当我编写我自己的软件时,我可以使用Object Test Bench等工具来直接探索和使用我的课程。 我正在寻找类似的东西,但是对于PowerShell,还有一些避免使用文本模式的东西。
PowerShell很不错,有很多很酷的“可发现性”,比如“Verb-Noun”语法,但是当我使用Exchange Server的时候,我想要得到一个AD列表接收连接器上的权限,我有这个列表:
[PS] C:\Windows\system32>Get-ADPermission "Client SVR6" -User "NT AUTHORITY\Authenticated Users" | fl User : NT AUTHORITY\Authenticated Users Identity : SVR6\Client SVR6 Deny : False AccessRights : {ExtendedRight} IsInherited : False Properties : ChildObjectTypes : InheritedObjectType : InheritanceType : All User : NT AUTHORITY\Authenticated Users Identity : SVR6\Client SVR6 Deny : False AccessRights : {ExtendedRight} IsInherited : False Properties : ChildObjectTypes : InheritedObjectType : InheritanceType : All User : NT AUTHORITY\Authenticated Users Identity : SVR6\Client SVR6 Deny : False AccessRights : {ExtendedRight} IsInherited : False Properties : ChildObjectTypes : InheritedObjectType : InheritanceType : All User : NT AUTHORITY\Authenticated Users Identity : SVR6\Client SVR6 Deny : False AccessRights : {ExtendedRight} IsInherited : False Properties : ChildObjectTypes : InheritedObjectType : InheritanceType : All User : NT AUTHORITY\Authenticated Users Identity : SVR6\Client SVR6 Deny : False AccessRights : {ExtendedRight} IsInherited : False Properties : ChildObjectTypes : InheritedObjectType : InheritanceType : All User : NT AUTHORITY\Authenticated Users Identity : SVR6\Client SVR6 Deny : True AccessRights : {ReadProperty} IsInherited : True Properties : {ms-Exch-Availability-User-Password} ChildObjectTypes : InheritedObjectType : ms-Exch-Availability-Address-Space InheritanceType : Descendents [PS] C:\Windows\system32>
请注意前几个条目是如何包含相同的文本的 – 无法轻松地将它们分开。 但是,如果有一个graphics用户界面,它可以让我更好地深入分析差异。
有没有这样的工具?
如果你想要一个graphics用户界面,升级到PowerShell 3有帮助,它具有Show-Command命令行,在其中input任何可用命令的名称部分,并在Windows而不是命令行中获取参数和帮助信息。
这只适用于命令,但它不知道你可能使用的数千个对象及其属性。
在你的情况下,你正在使用| format-list(fl)列出AD对象的属性。 通常显示对象的一些属性,但不是全部,请尝试:
fl *
显示对象的所有属性,或指定您感兴趣的属性名称:
fl User,Identity
完整的语法是:
format-list -property User,Identity