For my it Pro, PowerShell is really not easy to learn. No matter what it looks like in the future, it is now really a
scripting language , a
language ! I listen to functions, variables, objects, the headache of the people, today for the moment to list some concepts here, but also need to further digestion.
1. Objects in PowerShell
"Case": get-process
As shown, the results of the command execution are presented in tabular form, each line is called an "object", each column is called a "property", all rows are added together called "Collections", and "set" is called "table".
"Object": A table row that represents a single thing, such as a process, a service;
"Properties": Table columns, I understand: like the entity properties in a relational database, grouped together to describe an entity, such as: process name;
"Collection": the collection of all related objects in memory after the command executes;
"Method": that is, the behavior, that is, what the object can do, such as: Kill a process.
2. Why PowerShell uses objects
This part looks specious, indefinitely. The idea is that, compared to the Shell in Unix or Linux, the former is purely text-based, and PowerShell uses objects to eliminate all the overhead of text manipulation, allowing the user to focus on accomplishing the task. PowerShell only needs to know the column name, no need to care about the order of the columns in the table, or rewrite the command after the column is moved.
This part has to be compared to see.
3. Explore Objects
"Command": Get-member
"Alias": Gm
"Role": Understanding Object Content
"Usage": Used after any command that can produce some output.
"Case": get-process | Gm, Get-service | Gm
Completely dizzy dishes, slowly, slowly.
PowerShell Learning Notes-Object (i)