8.4. Summary

In this chapter, I started with the basics of creating and invoking scripts. Real scripters are never content with the basics, so I continued by demonstrating how to pass parameters, pipe objects, and return values from a script. We did that by comparing script files to functions and script blocks—when it comes to rules about passing parameters, processing pipeline input, and returning values, those three objects behave in the same way.

An important section of this chapter was dedicated to using PowerShell from other environments like cmd.exe and integrating it: you learned how to call a PowerShell script and how to return a meaningful exit code. This makes our script files good citizens in the console application world.

Last, but ...

Get Pro Windows PowerShell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.