Suppress console output in PowerShell/Batch
· One min read
Powershell When exception is occured, Out-Null is actually not worked, so uses
Get-ChildItem aaa >$null 2>&1
Or in Powershell 3
Get-ChildItem aaa *>$null
Batch/Dos
dir aaa >nul 2>&1
Powershell When exception is occured, Out-Null is actually not worked, so uses
Get-ChildItem aaa >$null 2>&1
Or in Powershell 3
Get-ChildItem aaa *>$null
Batch/Dos
dir aaa >nul 2>&1