In the previous lesson you learned how central commands can be used to provide perimeter input without
using the pipeline.
In some cases you might have to manipulate the objects produced by a burn center command so that the
command's output is of the type the parameter requires.
For example suppose that you wanted to list all the processes running on every computer in the domain.
For this example imagine that you have a very small lab demand that contains just a few computers you
can get a list of every computer in the domain by running this command.
Get a computer does filter asterisk.
Remember the asterisk is wild card for all their computers for all the properties.
However that command produces objects of the type a computer you could not use LOTES objects directly
in a person Tichel command such as this one get browsers.
There's computer name and in parenthesis get a D computer there's a filter asterisk the computer name
parameter.
Expect objects of the type stream but that is not what the percent command is produce.
Basically the computer name parameter just wants the computer name.
However you are given it an object that contains a name and operating system version and several other
properties.
Would this command work get process.
Does computronium and in parenthesis get a computer does filter all pipe it to select object's property
name that command selects only the name property.
But that property is still a member of whole Adey computer object.
It is the name property of an object although the name property contains this dream.
It is not itself a stream the computer name parameter expects as Drian not an object having a property.
The next command will achieve the goal.
Get Brosius computer name and in parenthesis retyped the following.
Get a computer.
This filter asterisks and pipe it to select object Dasch expand property name the expand property perimeter
except one and only one property name.
When you use the parameter only the contents of the specified property are produced by select object.
Some people refer to this as extracting the property contents.
The official description of the feature is expanding the property contents and the recipient command.
The result of the parenthetical command is a collection of strings and that is what the computer's name
parameter expects.
The command will work correctly although of course it may produce an error if one or more of the computers
can be reached on the net.
And again let's have some demonstration examples and we shall see how to use parameter expansion or
extraction to provide input froma receptacle command.
Let's open the windows power cell integrated script and environment and run a command that will list
all computers in the domain.
So let's try get a computer there's a filter asterisk this retrieves a list of computer objects.
These are full objects with several properties each.
Now let's run a commodity to as a percentage called command to display a list of services from every
computer in the domain.
Let's drive get service does computer name and in parenthesis get a computer does filter asterisk.
Our goal is to display a list of services that are running on every computer in the domain.
Let's run a command that shows the kind of object Prady used when you retrieve every computer from the
domain.
To do that let's dive get 80 computer this filter asterisk and pipe it to get member command.
The command produces objects of the type.
Computer as shown by the output of God member.
Now let's review their help.
Forget service to see what kind of object its computer name parameter expects.
So let's type help get service there show window and from here you could file that computer name parameter.
Except objects of the types Drian.
But our example with a central command is produced in objects that are not of that type stream.
Therefore the command will not work.
The person to kill command is not producing the kind of object that the parameter requires.
Now let's run a command that selects only the name property of every computer in the domain.
Let's type get the computer does filter the risk and part that to select object Despereaux up to name
this does select only the name property the computer name parameter wants and name and the name property
contains a name.
So let's Ramm get a computer filter asterisk can select object property name and get member the output
of select object.
And this example is still an 80 computer object.
It is not a stream.
Again let's run get a the computer and select object with expand property parameter expand property
except a single property name and it extracts the contents of the property.
The following command.
Get a computer pipes select object Desch expense property name 5 get mamber is use an expense property.
The output of select object is now has three and that is a kind of object.
The computer named parameter expects.
Now let's change the barycentre Tcl command to read the following.
Get a computer filter all and pipe it to select object expand property name that will retrieve every
computer object from the domain and extract the contents of their name properties as a stream.
Those strings will be given to the computer named parameter.
If you run that command you might see errors.
If a computer is not on line or available however the command will try to contact each one.