O'Reilly logo

PowerShell Deep Dives by Edited by Jeffery Hicks, Richard Siddaway, Oisín Grehan, and Aleksandar Nikoli

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

Chapter 19. Inline .NET code

Richard Siddaway

PowerShell is .NET-based. This enables you to use the .NET framework in your PowerShell scripts by loading the relevant assemblies into PowerShell (if they aren’t part of the default assembly set) and then using them via New-Object. You can create intricate GUI applications as a front end to your scripts, for instance. Whether you should or not is a discussion for another time.

You can also use .NET code directly in your scripts, which is the topic of this chapter. You’ll see two ways of using .NET directly in your scripts. The first way involves creating a .NET class that you can then use for output or future processing. The second way enables you to create a class with methods you can use in ...

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