Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Windows PowerShell for .NET Developers - Second Edition

You're reading from   Windows PowerShell for .NET Developers - Second Edition Efficiently administer and maintain your development environment with Windows PowerShell

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781785287435
Length 330 pages
Edition 2nd Edition
Arrow right icon
Toc

Exploring .NET objects

An object is nothing but a combination of methods and properties in PowerShell. Using Windows PowerShell, we can store a reference to an object to a variable and use it in the current shell as required.

We discussed in Chapter 1, Getting Started with Windows PowerShell that PowerShell takes advantage of the underlying .NET framework. So, the objects are a representation of the parts and actions to use it. An object is a combination of the properties and methods (Objects = Properties + Methods).

For example, a Windows service object has properties and methods. The properties are Get and Set, and the methods are invoked to perform a meaningful operation.

Consider the following image:

Exploring .NET objects

Creating .NET objects

We have discussed objects in a few of the preceding examples as well. In this section, we will explore the .NET objects in PowerShell. In order to create a .NET object, we will use the same New-Object cmdlet, but instead of the COM object, we will use different types of...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image