O'Reilly logo

Windows PowerShell for Developers by Douglas Finke

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 5. Add PowerShell to Your GUI

Adding scripting support to your application is one of the most valuable things you can do for your client, letting them add value to your software, and keep it current over time with little or no overhead from the developers.

Roy Osherove, author and consultant (http://bit.ly/K0xClG)

When you add PowerShell to an application, other developers, end users, testers, and system integrators can customize the application’s logic to better match their specific needs. This approach is an efficient use of resources; developers can focus their efforts on core functionality while allowing others to easily and independently customize the application as they desire. Using PowerShell in this way obviates the need to distribute the application source code for other developers to extend the application. As a result, you do not need to support multiple versions of the application.

Thus, not only does adding PowerShell to an application speed software development, but it also allows for common areas of application customization such as modifying code to match particular businesses processes, automating repetitive tasks, adding unique features, and accessing internal and remote data.

Embedding PowerShell in your C# Application

PowerShell is surfaced as a command-line application (the console), a scripting language, and an API. In this section, I’ll show you the API and how simple it is to create the PowerShell engine, call some cmdlets, and print out the results. ...

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