O'Reilly logo

Windows PowerShell 4.0 for .NET Developers by Sherif Talaat

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with .NET objects

In Chapter 1, Getting Started with Windows PowerShell, we discussed the relation between Windows PowerShell and the .NET framework, and we saw how .NET is adapted in PowerShell in different examples. In this section of this chapter, we will be working intensely with .NET objects in PowerShell.

Creating .NET objects

In order to create a new .NET object, we usually use the New-Object cmdlet that it is similar to the new operator in languages such as C#. Yes, I said usually because you might use casting to convert a PowerShell object to a .NET object as seen in Chapter 1, Getting Started with Windows PowerShell. The New‑Object cmdlet is used to create .NET objects and COM objects, but the parameters are different in the case ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required