Skip to main content

Posts

Showing posts from April, 2014

PowerShell Tips #2 - Working with Multi-Instance or Nested Properties

The objective here is to create reports of objects that contain properties with multiple instances, or nested properties. Example is Get-DNSServer Get-DNSServer by itself, with no parameters, produces a very detailed, multiple-heading report with a ton of detail.   The internal code to produce this report will be the subject of another technote. For this exercise though, see the outout from the command PS C:\ > Get-DnsServer |gm -MemberType Property Name                       MemberType Definition ----                       ---------- ---------- PSComputerName             Property   string PSComputerName {get;} ServerCache                Property   CimInstance#Instance ServerCache {get;set;} ServerDiagnostics          Property   CimInstance#Instance ServerDiagnostics {get;set;} ServerDsSetting            Property   CimInstance#Instance ServerDsSetting {get;set;} ServerEdns                 Property   CimInstance#Instance ServerEdns {get;set;} ServerForwarder            Property   Cim