CHAPTER 4

image

Writing Scripts

This chapter focuses on PowerShell features critical to developing professional code. We will start by discussing the Set-StrictMode cmdlet that protects us from uninitialized variables, incorrect method calls, and invalid property references. Then we’ll discuss how to gracefully handle errors raised when your scripts execute. Error handling leads us into a discussion of common cmdlet parameters, so called, because all the built-in cmdlets support them. Then we introduce the PowerShell Integrated Script Environment’s debugging features. Since PowerShell has excellent support for event-driven programming, we proceed with ...

Get Pro PowerShell for Database Developers 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.