I Personaly think Learning Objects is one of the most elementary and the most Important aspect in learning Powerhsell.
Have you ever wondered what makes PowerShell stand apart from a traditional Linux shell like Bash, or even the legacy command prompt? The answer is really simple: traditional shells output text, which makes it tricky to do things like formatting and filtering.
But Powershell is built upon .Net Framework which has advantage of underlying .Net classes which takes a different approach, using objects instead of text.
CLASS : a set or category of things having some property or attribute in common and differentiated from others by kind, type, or quality. For example Human race is a class or collection of individual Human beings.
In terms of Powershell a set of services is a class, as all have some attributes common in them, like Status, Name etc.
OBJECT : An Instance or Single Occurrence of a class. Objects are like real world entities that comprises of some Characteristics \ Attributes \ Properties and Functionalities.
In terms of PowerShell, Object is a single entity of a Class (.NET Class) that has some attributes (Known as Property) like ServiceName, Status, ServiceType, Site etc.
And some functionality (Known as Methods)
ACCESSING PROPERTY AND METHODS OF OBJECT :
To access the property or method of an object we use DOT Operator ( ‘ . ‘ ), let me show you through some examples.
Hope you will get better understanding of Powershell Objects and its utility after reading this article.
Happy Learning ! 🙂
Prateek Singh
Related posts
0 Comments
Leave a ReplyCancel reply
Categories
Author of Books
Awards
Open Sourced Projects
Author at
Blog Roll
Mike F RobbinsDamien Van Robaeys
Stéphane van Gulick
Kevin Marquette
Adam Bertram
Stephanos Constantinou
Francois-Xavier Cat
Ravikanth Chaganti
Roman Levchenko
Blog Stats
- 1,132,526 People Reached
[…] there is a very strong reason for that, If you remember on of my articles on Objects and Its Usage, that an object is an instance of a class. That means the $service variable has an old occurrence […]
Hi!
I have some questions:
1) Classes in powershell has methods such as classes of other programming languages or methods is only on objects?
2) What are the differences between Powershell classes and classes in others programming languages? and Objects?
Sorry for my bad english
Thanks
[…] there is a very strong reason for that, If you remember on of my articles on Objects and Its Usage, that an object is an instance of a class. That means the $service variable has an old occurrence […]