Redirection to null

Redirecting output to null is a technique that's used to drop unwanted output. The $null variable takes the place of the filename:

Get-Process > $null 

The preceding example redirects standard output (stream 1) to nothing. This is equivalent to using an empty filename:

Get-Process > '' 

The stream number or * may be included to the left of the redirect operator. For example, warnings and errors might be redirected to null:

.somecommand.exe 2> $null 3> $null 
.somecommand.exe *> $null 

Redirection like this is most commonly used with native executables; redirection is often unnecessary with PowerShell commands.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.104.214