Objects, Properties and Methods Part 1
Server Academy Members Only
Sorry, this lesson is only available to Server Academy Full Access members. Upgrade your plan to get instant access to this and many more premium courses. Click the Upgrade Plan button below to get started.

Saving Progress...
The use of Objects is probably one of the most confusing parts of Powershell. By using illustrations or word pictures we hope to clarify PowerShells use of objects. If you have never programmed or scripted with objects, it’s critical that you gain an understanding of objects. If you are experienced and comfortable with the concept of objects you can skip this section.
Objects
The Boat
- 1) So what are objects? Objects are things that we can interact with. For example: Like a boat or a car. Technically an object is the programmatic representation of anything.
- An object is a cmdlet created by a developer.
- 2) So why use a boat to illustrate an object? Because a boat is something that we have all seen and we all understand.
- 3) Objects are usually considered as two types of things, Properties and Methods.
- 4) Let’s take a look at some of these properties of our boat.
- 5) Properties describe features, so let’s checkout some of these features.
- 6) There’s our spot light, life preserver, COMS device, windows, and our engine.
- 7) Now let’s take a look at Methods. Methods describe actions or in this example things that we can do with our boat.
- 8) Like Turn on the light, Throw the life preserver, track ships with our communication device, clean the windows and start the engine.
- 9) Here’s another way to show properties and methods.
The Car – Let’s take a look at another example.
- 10) We already said that an object can be a car.
- 11) And that Objects consist of Properties and Methods.
Properties describe the features of an object
Let’s take a look at some of the features of our car
Like headlights, wheels, side mirrors, our steering wheel, spoiler, and the door handle.
- 14. Methods describe actions or things that we can do with our car
- 15. Like turn-on lights, add air to the tires, check for traffic in our side mirror, turn left using our steering wheel. Clean the dirt off our spoiler. And use the door handle to open the door.
BTW, this is not my car this is a 3.5 million dollar Bugatti sports car.
Server Academy Members Only
Want to access this lesson? Just sign up for a free Server Academy account and you'll be on your way. Already have an account? Click the Sign Up Free button to get started..