The Community Book of Powershell Practices Master by Powershell.org - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

17. PURE-04 Wrap other tools in an advanced function or cmdlet

That said, you truly become a better PowerShell person if you take the time to wrap a less-preferred way in an advanced function or cmdlet. Then you get the best of both worlds: the ability to reach outside the shell itself for functionality, while keeping the advantages of native commands.

Ignorance, however, is no excuse. If you’ve written some big wrapper function around Ping.exe simply because you were unaware of Test-Connection, then you’ve wasted a lot of time, and that is not commendable. Before you move on to a less-preferred approach, make sure the shell doesn’t already have a way to do what you’re after.