PowerShell object--powershell from zero start series five

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.