There is no feedback unless
the command fails. To see the values stored in the variable, simply enter the name:
[PS] C:\ > $exservers
Name Site ServerRole Edition AdminDisplayVe
rsion
---- ---- ---------- ------- --------------
MB001 Default-First-Sit... Mailbox,... Standard... Version 8.0...
Typing the name of the variable $exservers results in the redirection of its contents to the screen. The
output in this case is the same information that would have been displayed if the command used to
define the variable was run instead, so it retains the output format specified to the cmdlet.
Once an object it stored in a variable, it can be used as input to any cmdlet that takes that object type.
Keep in mind that the variable is storing an object ??™ s properties as well. This allows you to dereference
individual property values by using dot notation. For example, the following command displays the
values stored in the ServerRole property:
[PS] C:\ > $exservers.ServerRole
Mailbox, ClientAccess, HubTransport
To see all the possible properties that you can dereference from a user - defined variable, use the
Get-Member cmdlet followed by the InputObject parameter to specify the variable and
the MemberType parameter to specify Property as shown in this example:
[PS] C:\ > get-member -InputObject $exservers -MemberType Property
TypeName: Microsoft.
Pages:
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95