The question of what an object is, for a long time,
it can be either an abstraction of a physical entity or an artificial concept, or a person and something with a definite boundary and meaning.
Why should PowerShell use objects first?
- You always need some way to represent the data
- Windows itself is an object-oriented operating system
- Make things easier
Although you can interact with Windows PowerShell by typing commands in the text box, Windows PowerShell is still based on objects, not text. The output of the command is an object. You can send an output object to another command as its input.
Like the results we get from running commands.
Object-As you can see in the table row, it represents a single thing, such as a single process or a single service.
Attribute-the so-called "table column"-that represents part of the information about the object, such as the name of the service and the state of the service.
Method-the so-called "behavior" that associates a method with an object and enables the object to accomplish certain tasks, such as stopping or starting a service.
Collection-This is a collection of all objects
So how do you get an object in a collection?
We know that a service not only contains the three attributes of status, name and display name, but also the startup type, dependent services, and so on, to view all the information of an object, which can be viewed in a formatted list or exported way.
Well, after the introduction of the object, we have no need to find all the information headache
PowerShell object--powershell from zero start series five