PSCX 2.0 Show-Tree

One issue with PowerShell providers is that only the Filesystem and Registry providers’ hierarchies are easily viewable using Windows Explorer and Regedit respectively.  The other PowerShell providers are mostly without such a view.  This is problematic for providers that supply configuration information like the WSMan provider.  Without a lot of cd’ing around it is hard to get a “lay of the land” with respect to the various settings that are available. 

In Pscx 2.0, we set out to help with this problem by providing the equivalent of the old DOS tree.com routine.  The command is called Show-Tree.  If you have the final PSCX 2.0 bits installed try this from an elevated prompt:

C:\PS> Show-Tree wsman: -ShowLeaf
WSMan:\
└──localhost
   ├──MaxEnvelopeSizekb
   ├──MaxTimeoutms
   ├──MaxBatchItems
   ├──MaxProviderRequests
   ├──Client
   │  ├──NetworkDelayms
   │  ├──URLPrefix
   │  ├──AllowUnencrypted
   │  ├──Auth
   │  │  ├──Basic
   │  │  ├──Digest
   │  │  ├──Kerberos
   │  │  ├──Negotiate
   │  │  ├──Certificate
   │  │  └──CredSSP
   │  ├──DefaultPorts
   │  │  ├──HTTP
   │  │  └──HTTPS
   │  └──TrustedHosts
   ├──Service
   │  ├──RootSDDL
   │  ├──MaxConcurrentOperations
   │  ├──MaxConcurrentOperationsPerUser
   │  ├──EnumerationTimeoutms
   │  ├──MaxConnections
   │  ├──MaxPacketRetrievalTimeSeconds
   │  ├──AllowUnencrypted
   │  ├──Auth
   │  │  ├──Basic
   │  │  ├──Kerberos
   │  │  ├──Negotiate
   │  │  ├──Certificate
   │  │  ├──CredSSP
   │  │  └──CbtHardeningLevel
   │  ├──DefaultPorts
   │  │  ├──HTTP
   │  │  └──HTTPS
   │  ├──IPv4Filter
   │  ├──IPv6Filter
   │  ├──EnableCompatibilityHttpListener
   │  ├──EnableCompatibilityHttpsListener
   │  └──CertificateThumbprint
   ├──Shell
   │  ├──AllowRemoteShellAccess
   │  ├──IdleTimeout
   │  ├──MaxConcurrentUsers
   │  ├──MaxShellRunTime
   │  ├──MaxProcessesPerShell
   │  ├──MaxMemoryPerShellMB
   │  └──MaxShellsPerUser
   ├──Listener
   │  └──Listener_641507880
   │     ├──Address
   │     ├──Transport
   │     ├──Port
   │     ├──Hostname
   │     ├──Enabled
   │     ├──URLPrefix
   │     ├──CertificateThumbprint
   │     ├──ListeningOn_1770022257
   │     ├──ListeningOn_1480808289
   │     ├──ListeningOn_4173834
   │     ├──ListeningOn_228071226
   │     ├──ListeningOn_1414502903
   │     ├──ListeningOn_222657401
   │     ├──ListeningOn_616175923
   │     ├──ListeningOn_783876958
   │     ├──ListeningOn_704030885
   │     ├──ListeningOn_405255605
   │     └──ListeningOn_1490189075
   ├──Plugin
   │  ├──Event Forwarding Plugin
   │  │  ├──xmlns
   │  │  ├──Name
   │  │  ├──Filename
   │  │  ├──SDKVersion
   │  │  ├──XmlRenderingType
   │  │  ├──lang
   │  │  ├──InitializationParameters
   │  │  └──Resources
   │  │     └──Resource_1958972577
   │  │        ├──ResourceUri
   │  │        ├──SupportsOptions
   │  │        ├──ExactMatch
   │  │        ├──Capability
   │  │        └──Security
   │  │           └──Security_371857150
   │  │              ├──Uri
   │  │              ├──ExactMatch
   │  │              ├──Sddl
   │  │              └──xmlns
   …

You can use this on most providers although some providers behave better than others under this command.  Here’s a way to view registry entries e.g.:

C:\PS> Show-Tree HKLM:\SOFTWARE\Microsoft\.NETFramework -Depth 2 -ShowProperty
HKLM:\SOFTWARE\Microsoft\.NETFramework
├──Property: COMPLUS_HACK_DisableSideBySide = 1
├──Property: DbgJITDebugLaunchSetting = 16
├──Property: DbgManagedDebugger = "C:\Windows\system32\vsjitdebugger.exe" PID %d APPDOM %d EXTEXT "%s" EVTHDL %d
├──Property: Enable64Bit = 1
├──Property: InstallRoot = C:\Windows\Microsoft.NET\Framework64\
├──AssemblyFolders
│  ├──Property: SubKeyCount = 10
│  ├──Property: ValueCount = 0
│  ├──ADOMD.Client 10.0
│  │  └──Property: (default) = C:\Program Files\Microsoft.NET\ADOMD.NET\100\
│  ├──Microsoft .NET Framework 3.5 Reference Assemblies
│  │  └──Property: (default) = C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\
│  ├──MSDeploy
│  │  └──Property: (default) = C:\Program Files\IIS\Microsoft Web Deploy\
│  ├──SQL Server Assemblies
│  │  └──Property: (default) = C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\
│  ├──SSIS Connection Managers 100
│  │  └──Property: (default) =
│  ├──SSIS ForEach Enumerators 100
│  │  └──Property: (default) = C:\Program Files\Microsoft SQL Server\100\DTS\ForEachEnumerators
│  ├──SSIS Pipeline Components 100
│  │  └──Property: (default) = C:\Program Files\Microsoft SQL Server\100\DTS\PipelineComponents\
│  ├──SSIS Tasks 100
│  │  └──Property: (default) = C:\Program Files\Microsoft SQL Server\100\DTS\Tasks
│  ├──v3.0
│  │  ├──Property: <IncludeDotNet2Assemblies> = 1
│  │  └──Property: All Assemblies In = C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\
│  └──v3.5
│     ├──Property: <IncludeDotNet2Assemblies> = 1
│     └──Property: All Assemblies In = C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\
├──NGenQueue
│  ├──Property: SubKeyCount = 2
│  ├──Property: ValueCount = 0
│  ├──WIN32
│  │  ├──Property: SubKeyCount = 2
│  │  └──Property: ValueCount = 0
│  └──WIN64
│     ├──Property: SubKeyCount = 2
│     └──Property: ValueCount = 0

Give PSCX 2.0 a try and let us know what you think – good or bad!

Advertisements
This entry was posted in PSCX. Bookmark the permalink.

3 Responses to PSCX 2.0 Show-Tree

  1. Shaz3e says:

    The specified release was not found.

  2. Pingback: How to save file structure to text file? | Yauger Answers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s