From the course: Learning PowerShell for Windows Server Administration

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Best practices and common pitfalls

Best practices and common pitfalls

From the course: Learning PowerShell for Windows Server Administration

Start my 1-month free trial

Best practices and common pitfalls

- [Instructor] When it comes to managing the end of the pipeline, there are few risks that you should be aware of as you try new things. That isn't to say you shouldn't test things out. Just do a little homework before making changes that could harm a production system. Some changes may seem like a good idea up front, but turn out to do more harm than good. So it's always good to have an exit strategy. When you make a change, test it out and confirm that it does what you expected. If not, undo the change while it's still fresh in your mind. Let me give you an example. I was reading the help page for Out-Default. And while there, I noticed that Out-Default is just a placeholder waiting for me to write my own function or cmdlet. That means that I can create my own Out-Default function that specifies custom output. Great idea, right? I can make my own Out-Default function that just returns the phrase this command completed successfully to the screen. So when I run commands like…

Contents