Powershell Best Practice #12: Avoid Out-Null cmdlet in your scripts

By | June 28, 2015

Best Practice: It is recommended to avoid Out-Null.

Explanation:

You should use $null or [void] instead (because they are faster than Out-Null).

When you want to suppress the output of a command (example: when adding items to a collection), using Out-Null is slower than [void] or $null.


previous-buttonnext-button

One thought on “Powershell Best Practice #12: Avoid Out-Null cmdlet in your scripts

  1. Pingback: Powershell Best Practice #13: Avoid double quotes in strings if not necessary | Powershell Guru

Leave a Reply

Your email address will not be published. Required fields are marked *